Updates from November, 2009 Toggle Comment Threads | Keyboard Shortcuts

  • Ben 11:39 am on 11/30/2009 Permalink
    Tags: performance, web-programming   

    Memory will be the real performance bottleneck on your VPS 

    This well-done benchmark comparison of several Virtual Private Server vendors gives me warm and fuzzies that I chose Linode for my new hosting provider. However, the benchmarks chosen mostly test CPU performance and the bottleneck when hosting a dynamic web site is likely to be memory capacity.

    The number of requests per second that your server can handle is determined by the maximum concurrent requests possible divided by the time in seconds to handle each request. Each Apache process running WordPress PHP scripts via mod_php consumes about 20 MB on my Linode. This means I can only run about 10 Apache processes and therefore handle 10 concurrent requests. If each request takes 150 milliseconds to process, 50 milliseconds transfer time and 100 milliseconds processing time, my server can handle 10 / .15 = 66.67 requests per second. Let’s assume another VPS vendor provides the same 360 MB as my Linode account but the CPU is half as fast. The requests might take 250 milliseconds so the server could handle 10 / .25 = 40 requests per second. In this situation, the faster CPU is a clear win. But several of the vendors in the review provide significantly more memory than my Linode account. If that slower processor came with 1024 MB memory, it could maybe run 45 Apache processes and serve 45 / .25 = 180 requests per second, far outstripping my supposedly faster Linode.

    As you add memory to a server, CPU will eventually become the bottleneck again, but my Linode rarely goes above 1% CPU utilization while serving 66 requests per second, so I think that number is probably quite high. There are also other web servers and Apache configurations that are a bit more memory efficient than what I am talking about, but with all of them you will still be limited by the number of 10-20 MB PHP processes you can fit in memory.

    I don’t regret choosing Linode as my VPS provider, they have great support and nice management tools. I also don’t expect to get anywhere near the traffic levels I talked about above. But if you are evaluating VPS vendors based on how much traffic you handle for the money you are paying, be sure to consider memory capacity.

     
    • davidw 9:46 am on 12/1/2009 Permalink

      Linode does pretty well in terms of memory usage, because it lets you choose 32 bit, as opposed to 64 bit (like Slicehost). I did some numbers of my own a while back, and while those were the only two I compared, Linode really won out: http://journal.dedasys.com/2008/11/24/slicehost-vs-linode
    • Ben 12:46 pm on 12/1/2009 Permalink

      Nice analysis, David. I wasn’t aware of the memory cost of 64 bit.

    • afternoon 9:17 am on 3/8/2010 Permalink

      I highly recommend a combination of nginx and FastCGI. I’m personally running both PHP and Python (Django) on a single Linode. I have 3 php-cgi instances resident at about 20MB each. nginx is resident at 2MB. Although the RAM usage is not much different, nginx serves static content, so the PHP processes service far fewer requests, raising the requests/sec limit.

  • Ben 1:06 pm on 7/9/2009 Permalink  

    Implementing Markdown with Regular Expressions 

    Jeff Atwood has a post about something I’m intimately with, implementing a subset of Markdown using regular expressions. After years of tweaking and user contributions, the regexps in the Markdown Vim syntax file are now so complex, even I don’t understand them.

     
  • Ben 6:52 am on 8/3/2008 Permalink  

    How to improve Free Software usability 

    Matthew Paul Thomas is back with an article about why Free Software has poor usability, with concrete suggestions for how to solve the problems. Thomas is an interaction designer who works for Canonical. You might remember his list of 69 usability problems in Ubuntu 5.04.

     
  • Ben 6:31 am on 7/12/2008 Permalink  

    Dependency Injection and Unit Testing 

    The Google Testing Blog has one of the clearest explanations I’ve seen of why dependency injection is useful. This got me thinking about how people handle this stuff in dynamic language land and I found Dependency Injection in Ruby and Needle, a DI container for Ruby.

     
  • Ben 3:51 pm on 2/11/2007 Permalink  

    The Next Big Language 

    Steve Yegge outlines the requirements for the next big programming language. Like some people in the comments, I note that Groovy fits the bill pretty well.

     
  • Ben 6:29 am on 11/13/2006 Permalink  

    Java Is Free 

    Tim Bray has the scoop on open source Java. It’s GPL! The official announcement goes out at 9:30 PST.

     
  • Ben 9:02 am on 11/8/2006 Permalink  

    GPLed Java 

    CRN says Sun will license Java under the GPL. All of the noises Sun has been making about wanting to prevent Java forks made me think they would use another not-really-free license so, if true, this is very good news.

     
  • Ben 5:36 pm on 7/17/2006 Permalink  

    Blog Publishing Models 

    Tim Bray explains why he doesn’t want to use a database with the comment system that he is writing for his blog. It turns out he’s talking more about the publishing model, dynamic or static, than the data store.

    Serving static files generated when you post something is much faster than generating the page every time a user visits, so you can handle many more concurrent visitors. I like the dynamic model, though, because I think it offers a better user experience. I used Blogger and MovableType before I switched to WordPress and the publishing step always seemed problematic. Site-wide changes required regenerating every blog post, which took a long time and was error-prone. Dynamic publishing doesn’t have this problem and has a simpler mental model, too. If you need performance, you can use the WP-Cache plugin, although I’m sure it’s not quite as fast as a fully static site.

     
  • Ben 9:31 am on 6/15/2006 Permalink  

    Krugle 

    Krugle, the new open source code search engine is live today. It feels like it will be very useful.

     
  • Ben 11:44 am on 12/23/2005 Permalink  

    The future of HTML 

    Ed Dumbill has an interesting article on developments in the HTML standards.

     
  • Ben 10:19 am on 10/6/2005 Permalink  

    Organizing my stuff 

    Here’s a nice article about organizing files in a Unixy manner. I especially like the “cliches” idea for code snippets.

     
  • Ben 12:28 pm on 8/17/2005 Permalink  

    Georges’ Sieve 

    Georges’ Sieve is a very concise piece of advice on technical writing. [via OSAF Blog]

     
  • Ben 11:31 am on 6/13/2005 Permalink  

    Flow, Stuckness, and Interruptions 

    Edd Dumbill points to a great article on programmer productivity. These are issues that any manager of programmers should familiarize themselves with if they really want to understand how programmers work. Experiencing Stuckness first-hand changed the way I think about multitasking and priorities. I used to think that switching back and forth between tasks was pointless because it would just mean that all tasks, except for the lowest priority one, would be done later than if I worked on them serially. For this reason I always wanted my managers to assign absolute priorities to the tasks they wanted me to do, so I would know what order in which to work on them. Then I realized that I was wasting lots of time banging my head against tasks on which I was stuck. These days I set a time limit, if I’ve been struggling with a problem for more than half an hour with no progress I switch to something else and come back to it later with a fresh perspective and, hopefully, new insight. So now I prefer it when managers give me multiple tasks with vague priorities, there’s nothing more frustrating than having to work on a stuck problem.

     
  • Ben 7:57 am on 5/26/2005 Permalink  

    The long tail of software 

    Excite and Jotspot founder Joe Kraus has an interesting post about how the long tail applies to software and how Jotspot fits into that vision. Short version: Jotspot is a platform for building custom applications and therefore services a large portion of the long tail.

     
  • Ben 12:45 pm on 5/19/2005 Permalink  

    The Regex Coach 

    The Regex Coach teaches you regular expressions by letting you step through them and explaining them to you in plain English. [via Flutterby]

     
c
Compose new post
j
Next post/Next comment
k
Previous post/Previous comment
r
Reply
e
Edit
o
Show/Hide comments
t
Go to top
l
Go to login
h
Show/Hide help
shift + esc
Cancel