Posted by Christopher J. Bottaro on Jul 26, 2011 in Blog | 1 comment
One of the arguments I frequently hear against threads is that the synchronization problems are a pain in the ass to deal with. They are hard to reproduce, hard to debug, blah blah, etc etc.
Well it turns out, I am kinda tired of dealing with broken threads in Ruby and also threadsaftey issues in gems which I don’t have control over.
So I’ve been playing around with...
read more
Posted by Christopher J. Bottaro on Jan 14, 2011 in Blog | 1 comment
Threading in Ruby as been busted for a long time. Back in 1.8.7, I actually got segfaults in threaded code. Thankfully, those went away in 1.9, but now I’ve come across a new problem which is almost as bad, save for that I can actually do something about it.
The problem happens when a thread locks a Mutex (or Monitor) inside a timeout block and the timeout expires before the thread can...
read more
Posted by Christopher J. Bottaro on Jan 7, 2011 in Blog | 0 comments
Either Rails.cache or memcache-client (or the combination of the two) is not thread safe. I was seeing symptoms like the wrong data being fetched for a given key (getting hash when expecting an array and vice versa). What’s worse is that some data even got written to the wrong keys.
At first I was going to make a SynchronizedMemCacheStore in the same spirit as SynchronizedMemoryStore in...
read more
Posted by Christopher J. Bottaro on Dec 18, 2010 in Blog | 1 comment
This is a guide on how to mimic an OS X file server using Linux and the open source implementation of AFP, Netatalk. These instructions are for Ubuntu Server 10.04, but should translate pretty easily to other distros.
I have a Linux NAS, but all my other computers are Macs. NFS is simple, but buggy. There are all sorts of problems if you disconnect from the network without unmounting first. ...
read more
Posted by Christopher J. Bottaro on Nov 18, 2010 in Blog | 0 comments
We switched back to Monit after experimenting some with God (oh, what a nightmare). This post is just meant to be a collection of tips for working with Monit. I’ll update it as I discover/remember more.
1. Monit does not honor limits.conf
We have a Solr process with 3 cores. The number of open file descriptors can get pretty big between optimizes, exceeding the default limit of 1024 in...
read more