Fixed Log Configs for SIngle-File Logging

October 16th, 2014

Storm Logo

This morning I wanted to take some time to make sure that I got all the log messages into one file, and that not being a redirection of stdout or stderr. This is something I've done a few times, and it just took the time to set up the Logback config file. The reason we're using Logback is that this is what Storm uses, and since this is a Storm jar, we needed to use this style of logging.

Interestingly, the config wasn't all that hard to get a nice, daily-rotating, compressing, log file for everything I needed:

<configuration scan="true">
  <appender name="FILE"
            class="ch.qos.logback.core.rolling.RollingFileAppender">
    <file>/home/${USER}/log/experiments.log</file>
    <rollingPolicy
        class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
      <fileNamePattern>
        /home/${USER}/log/experiments_%d{yyyy-MM-dd}.log.gz
      </fileNamePattern>
      <maxHistory>30</maxHistory>
    </rollingPolicy>
    <encoder>
      <pattern>
        [%d{yyyy-MM-dd HH:mm:ss.SSS}:%thread] %-5level %logger{36} - %msg%n
      </pattern>
    </encoder>
  </appender>
 
  <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
    <encoder>
      <pattern>
        [%d{yyyy-MM-dd HH:mm:ss.SSS}:%thread] %-5level %logger{36} - %msg%n
      </pattern>
    </encoder>
  </appender>
 
  <root level="INFO">
    <appender-ref ref="FILE" />
  </root>
</configuration>

I have to admit that this is a decent tool - if you know how to configure it properly. But I guess that's true for a lot of the Apache projects.

Re-Tuning Experiment Topology

October 15th, 2014

Finch Experiments

Anytime you add a significant workload to a storm cluster, you really need to re-balance it. This means looking at the work each bolt does, making sure there is the proper balance between the bolts at each phase of the processing, and then that there are enough workers to handle the cumulative throughput. It's not a trivial job, but it's a lot of experimentation and then looking for patterns and zeroing in on the solution.

That's what I've been doing for several hours, and I'm no where near done. It's getting closer, and I think I have the problem isolated, and it's very odd. Basically, there are a few bolt instances - say 4 out of 160 - that are above 1.0 - the rest are at least a factor of ten less. This is my problem. Something is causing these few bolts to take too long, and then that skews the metric for all the instances of that bolt.

Fixing Replication on Postgres

October 15th, 2014

PostgreSQL.jpg

This morning I noticed that my replicated database wasn't synced to the master, and that meant that something had happened to cause the master to be moving too much data, or have too long a pause time to keep synced. Re-establishing the link isn't all that hard, but it takes time - so I turned off the process feeding data into the master database, and then, as the postgres user I coped the files from the master to the slave:

  $ cd /var/groupon
  $ rsync -av --exclude postgresql.conf --exclude postmaster.pid
          pgsql/ db2:/var/groupon/pgsql/

and then I simply need to restart the properly configured slave, and restart, and the log will report:

  LOG: streaming replication successfully connected to primary

Refactoring Analytics for Multi-Mode Design (cont,)

October 15th, 2014

Finch Experiments

This morning I finished up the deployment of the code to UAT and then set about updating the docs in the GitHub/E repo for all the changes. This wasn't all that hard as most of it was already there, but I needed to make sure that I had the docs match the code in the server.clj namespace, and then the big job of adding the docs for the different attribution schemes.

I've got two schemes - the original scheme that wasn't all that good, and the new one looks at the order of the experiment experiences per session and then attributes the weight of the deal on those in a time-decaying fashion. It's not great, but it's a massive improvement over the old scheme.

I wrote all this up, with examples, and it's checked in for the front-end guys to use.

Firefox 33.0 is Out!

October 15th, 2014

Firefox3.5.jpg

I haven't used Firefox a lot, lately, but it's still a browser I keep updated because I read that it's starting to turn things back around. The new OpenH264 in Firefox 33.0 should be an interesting take on the video streaming, and it's fast enough, so maybe I'll look at it a little more.

I really did like the workspaces concept, but I just didn't get the feel that it was as smoothly integrated as it could be. Maybe it's getting better?

How Useless a One-on-One Can Get

October 14th, 2014

PHB.gif

I'm not an easy person to life with - nor one to work with. I'm demanding of myself, and in that, most people think that even if I'm not visibly demanding of them, I am, internally, very disappointed in them if they aren't achieving the same levels. That's not the case, and as much as I try to correct that misconception, it persists. Still, I try to be a Team Player - do the jobs that need to be done regardless of how I feel about them. But I have to confess that a useless One-on-One is something I'm about to opt-out of.

I have a manager that believes he's a good manager to all. He's not - at least not to me, but that doesn't factor into his thinking. He wants to get my feedback - which is always the same - this group is split along the lines of those that do, and those that primarily sit around. If I were in the latter group, I'd be happy - but I'm not, and the group I'm in has a population of 1.

What happens is that Management pushes down on me to deliver, and I do my best to meet their expectations. It's hard work because I'm delivering things for many different groups, and so when I look around and see people playing cards at lunch, or arriving at 9:00 am, it's hard not to feel like I'm being taken advantage of.

So I have a one-on-one with a guy that doesn't understand the first thing about what I'm doing. He doesn't even know who I'm working for - what they are asking, when they are asking it, and what those deadlines are. He is my Manager in name only. And yet he wants a one-on-one.

Silly. And I've had enough of silly.

Refactoring Analytics for Multi-Mode Design

October 14th, 2014

Finch Experiments

Today has been a lot of coding on a change that I was asked to do - and in truth, it's a nice feature to have in the experiment analytics. It's basically the request that all attribution schemes be active in the system at once, and then there is just a different URL for the different versions of the code and data.

This is not unlike what I've done in the past, and it's a good way to allow things to be isolated and roll-out new features without having to mess with a long and involved testing process. But the problem here is that we have a finite redis space, and there's only so much I can do at 50k msgs/sec, and while I would love to have all the versions running side by side, I've already had problems getting the first one working and fitting in redis.

I know this doesn't compute to the current Management, and it's sad that the guy doesn't really understand what's going on and just admit it. Sadly, that seems to be hard for a lot of managers - it makes them seem more human, but at the same time, forces them to expose their weaknesses.

Anyway... I've been re-writing this code all day, and I think I have it all code complete. In the morning I'll try it out in UAT and see how it goes.

Updating Message Forwarders

October 14th, 2014

Unified Click

Over the last few days I've been refactoring the code to publish not only to my attached kafka cluster, but to the shared kafka cluster in the data centers. This hasn't been the most reliable in the past, but I was getting a lot of pressure from Management to do this when the load on my cluster got too much to handle, and while I pushed back for Quality of Service (QoS) reasons, when the clients agreed that I would no longer be responsible for the latency once I handed it to the shared cluster, I relented.

At the same time, I've been responsible for the forwarding of messages from one data center to the other because the group that was generating the data would not make the move on it's end, and a sensitive project needed this data. So once again - because I can, I have to.

The intersection of these events is what I was working on this morning - forwarding from one kafka cluster to another for the purpose of having the messages be seen in both clusters in all data centers. It's not hard work, and I have monitors and such set up to make sure it's working, but the idea that a product team is doing the message shuffling is just... well... crazy.

Amazingly Poor Management Style

October 13th, 2014

PHB.gif

I'm no paragon of virtue about anything. I'm even willing to admit that I might not be everyone's cup to tea. But I do believe I know my limitations pretty well, and one of the things I know I'm not that good at is management. So when I see someone manage me in a way that I'd never manage a person, I know it has to be exceptionally bad management.

Such is the case today.

I released a new version of the experiment analytics to UAT, and sine it had significant differences in the counting and attribution code, it made sense to me to have it run side-by-side with production, and the old models, for several weeks to let this new system prove itself out.

You'd have thought I took an Uzi to a class of third graders.

The uproar from my management was immediate and complete open-loop. The statement was that we had to support both for forever. Now, I'm no Rocket Scientist, but even I know that given the problems we've had to date fitting just the one set of analytics in a real-time Storm cluster and on four 192GB Redis boxes, the idea of doubling that wasn't one I wanted to do.

Clearly, managers are so much smarter than I am, and they know exactly how much redis space it'll take, and exactly how many CPU cycles the second treatment will consume. How silly of me to not consider their genius. Yes, clearly, I have very little regard for this decision because it was made thinking that they were still in their little playground with Rails and 5000 machines in the data center.

I try not to be hard on those that don't get it - but this response did make me pretty steamed. So to the guy that insisted that I add support for all versions at the same time, I sent back an email saying "Hey, I have two ideas - which one do you like?" - just to get his feedback since he was so adamant about the inclusion of this in the product.

"That's not my job to decide - Doers Decide"

OK, so let's get this straight - You are insisting that this feature be added, but you have no opinion on it? I find that remarkably hard to believe. In fact, I think with near-certainty you're a liar. You either don't know why you're asking for this feature, or you really do have an opinion, and so in one case or the other, you're a liar.

It's things like this that make me realize that good people don't necessarily make good managers. And even good managers in some fields are horrible managers in others. Such is the case with this guy - he was my manager a year ago, in a different group, but here - he's so out of his league it's sad to see him do things like this.

Thankfully, there are recruiters.

Balancing Kafka Readers to Shared Kafka Cluster

October 10th, 2014

Kafka Broker

Today has been a bad day. We had just a little too much traffic, and one too many clients on our kafka cluster in production, and the consequence was that the kafka cluster started to generate back-pressure on the Storm topology bolts writing to the cluster, and that, in turn, caused back-pressure up the topology, and that caused way too much latency.

So I had to do something.

I could have asked for three more boxes, and I did, but I knew they weren't going to be available in time. Management said they wanted me to use the shared Kafka cluster operated by the Operations group, but their attitude about the data passing through them is that of a Common Carrier - "I don't care what it is", so they take no responsibility for it.

Still it was the only option, and when I got the release from the clients that I could not be held responsible for the data one I'd handed it off to the shared kafka cluster, I added the code to be able to do just that - publish to two kafka clusters - mine and theirs.

The load I put on theirs threw them on their heels at first, and I hope they get it all cleared up soon, but I have a feeling that my weekend is going to be filled with monitoring the latency through the system.