Minimal Apache/Rails configuration on small virtual server
November 23, 2008 on 3:31 pm | In Programming | No CommentsAs I’ve mentioned before I’m running a couple of WordPress blogs and a Rails application on Slicehost, using the smallest slice size of 256 MB RAM. Apart from Rails, this is a typical LAMP setup with Ubuntu Hardy Heron, Apache2-prefork, MySQL 5.x, PHP5. It took a little while for me to find a robust Apache and Rails configuration, though. The out of the box Apache2 config would periodically eat up all the swap space and die. So my hope here is to save others some newbie-sysadmin headaches.
Apache2. Apache2 prefork is configured to keep a certain number of processes running to respond to HTTP requests that come in. These processes are reused across a number of requests and thus tend to grow over time in their memory consumption to reach the largest amount of RAM demanded by any page served. When using mod_php, the RAM consumption is related to PHP application resources, in this case WordPress. I found that my Apache processes generally were in the 20m range for resident memory size (the RSS column in the ‘top’ display). With the out-of-box Apache2 configuration allowing as many as 15-20 processes, that meant that any large batch of concurrent requests (such as those originating from a search bot) would totally nail my machine. So the most important change I wound up making was to reduce the number of processes:
<IfModule mpm_prefork_module>
StartServers 3
MinSpareServers 3
MaxSpareServers 3
ServerLimit 10
MaxClients 10
MaxRequestsPerChild 1000
</IfModule>
This generally causes me to see around 5-6 processes running, with the possibility of as many as 10.
A number of folks have suggested I run nginx or lighttpd, which I’m sure would be a great idea, but I was strapped for time and in a mood to stick with things that have lots of online recipes and that I already somewhat understood.
Rails. Various approaches are available here as well. At first I was running the mod_passenger module, but I found this gave me a few 30m processes as opposed to the single 50m process I could get by running a single mongrel. So now I’m running a single mongrel and it’s working fine.
MySQL. Haven’t tuned this much yet, but I’m not seeing any problems.
WordPress. Caching is enabled on the advice of a number of people that this will decrease MySQL resource consumption.
Flexcover 0.81 is out
November 18, 2008 on 3:12 pm | In Flex, Programming | No CommentsA quick update: Alex Uhlmann and I have just released the latest Flexcover edition on our Google Code Project. This release supports the newly announced Flex 3.2 SDK, Flex Builder 3.0.2 and AIR 1.5.
Vote for sampled audio to not crash IE7
November 17, 2008 on 11:55 am | In Flex, Programming | 1 CommentTurns out there’s a nasty bug in sampled audio playback in the newly released Flash 10 player. Found by Tyler Wright of Legato Media, this bug takes down your entire IE7 browser if you open simultaneous windows with Flash content, one of which is playing back audio using the new SampleDataEvent API. This is a crippling problem for any ambitious Flash content on the web incorporating dynamic audio.
Fortunately, we now have the prospect of an American President who can speak in intelligible sentences… which means that you can turn all of your positive energy to getting Adobe to fix this bug. Please vote on it at:
https://bugs.adobe.com/jira/browse/FP-985
Future generations thank you! (Future generations of what, you may ask?)
Flexcover upgrade for Flex 3.2.0 SDK is looking good
November 11, 2008 on 2:29 am | In Flex, Programming | 3 CommentsAlex and I — lately, to be honest, it’s mostly Alex — have been working on the forthcoming upgrade release of Flexcover, the code coverage instrumentation tool for Flex/AS3. I’m feeling pleased because I finally merged up the modifications to the Flex SDK compiler to the 3.2.0 branch, in preparation for an expected release of a new Flex Builder in the MAX timeframe.
The merge went smoothly and the 3.2.0 compiler seems to work like a champ — well, at least, it does everything that the 3.0.x version did. What’s more, a sneak peek at Flex Builder 3.2 revealed that they’ve fixed an irksome bug in the Flex Compiler project options dialog, and it’s now possible to enable and disable coverage instrumentation using the compiler options field.
That’s just the part I did. Alex has been busy working on some very nice changes to the CoverageViewer, which should greatly reduce the performance problems people were seeing during data collection before. We’ve also made it much easier to merge reports from multiple test runs. A few more fixes are needed but things are looking up…
Host of Broken Dreams
November 6, 2008 on 4:15 pm | In Miscellaneous | No CommentsThis site has been up and down like a yo-yo since Friday. All is better, though now that I’ve moved this domain and the Noteflight blog to a new hosting company: Slicehost. Slicehost seems very cool — they offer what seems at first like a bare-bones service (VPS hosting starting with a minimal Ubuntu Linux distro, no one-click installs or control panels). But it’s not so bare-bones once you realize that Slicehost provides really, really clear how-to articles that make it very straightforward to set up all the same stuff that you’d normally get from a more standard hosting service. And when you’re done doing what these articles explain, you understand how it all works: a great benefit. And you’ve got total control over the system you build, with root access and all. No one can @#$% with it. For an example of being @#$%ed with, you may continue reading. [Continued...]
David Coletta at Boston Flex Users Group 11/11
November 6, 2008 on 1:17 pm | In Uncategorized | No CommentsA quick squib here to note that my friend David Coletta will be talking about building unified codebases for AIR and Flex at the November Boston Flex User Group meeting.
Go see David. Go see David. Go see David.
Is there anything about “Go see David” that you don’t understand? He’s a dynamic, intelligent and very, very informative speaker. Hope to see you there!
Entries and comments feeds.
Valid XHTML and CSS.
All content copyright (c) 2006-2007 Joseph Berkovitz. All Rights Reserved.