Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Thu Jun 24, 2010 10:17 am 
Offline
Senior Newbie

Joined: Thu Jun 24, 2010 10:07 am
Posts: 18
Hello everyone, I was just reading up in the linode community library, and it was talking about low memory configurations for your web server. Now, my question is, what is the downside of low memory configurations? Obviously, you are supposed to get better performance overall, but if it was good for every system, then it would be implemented by default, yes? So where are the downsides? Less visitors overall? Etc.

And secondly, I'm running a Ubuntu 10.04 server on the Linode 720 with lighttpd, mysql, and the lua module to run drupal - how many concurrent connections could I expect to reasonably serve? Thanks


Top
   
 Post subject:
PostPosted: Thu Jun 24, 2010 4:49 pm 
Offline
Senior Newbie

Joined: Fri Jun 18, 2010 1:59 pm
Posts: 12
Most of the time, a low memory profile will limit connections, thus limiting the amount of requests/visitors that can get to your site in a timely fashion. If your site gets a lot of visitors on a low-mem profile, you'll see queues piling up for certain services (mysql and apache most likely).

There's no such thing as a low-mem profile that can handle heaps of requests, you're basically trading off speed for expandability, if that makes any sense.

I've been used to lighttpd for the past 3 years and slowly forgot how bloated apache really is, and with my current default lamp settings, apache seems to be quite a hog compared to how lighttpd was handling things. Your main issue would be mysql, especially if you're running lighty. IMO, on a 720 with default settings on all services, you'll be fine with a moderate-high load.


Top
   
 Post subject:
PostPosted: Thu Jun 24, 2010 10:04 pm 
Offline
Senior Member

Joined: Fri May 02, 2008 8:44 pm
Posts: 1121
You won't be able to get a definitive answer here, because Drupal is the most important variable here. Depending on which modules you use and how your pages are composed, Drupal can be anything from a lightweight PHP script to a 100-database-queries-and-100MB-memory-per-request monster.

One thing that's really good about lighttpd + fastcgi is that you're very unlikely to have an out-of-memory crash even when you get a lot of visitors. Static requests use virtually no RAM, and you'll be serving at most PHP_FCGI_CHILDREN dynamic requests at the same time. (All the other requests will be queued.) This is the setting that controls how much resources Drupal will use, which is directly related to how hard MySQL will have to work. 8 is a reasonable value for a quad-core server, and you can expect PHP to use 150-250MB of RAM. This also means that MySQL gets at most 8 connections at any given time.

As for MySQL, the "low-memory" profile with a key_buffer of 16KB, in my opinion, is way too low for today's high-powered Linodes. Those were designed for yesteryear's VPSs with 128MB of RAM. The key_buffer should be at least as large as the size of all your indexes after the content is loaded, which I assume would quickly grow to a few megabytes for an average forum site. This is crucial for database performance. Low-memory might sound good, but you need to keep in mind that 720MB (1024 after the recent upgrade?) is hardly the "low-memory" VPS of 2006.

As a very rough rule of thumb, I'd give 20-25% of my RAM to the PHP FastCGI processes, 25-30% to MySQL, 10-20% to all the other processes (lighttpd, postfix, etc.), and leave the rest for buffers and cache. Anything more will probably hurt performance due to excessive I/O. Anything less and you're probably not making full use of the resources you paid for.

I used to have a database-heavy PHP site on a Linode 720 running on lighttpd and MySQL, and I had no problem serving over 50K pages per hour. YMMV.


Top
   
 Post subject:
PostPosted: Sun Jun 27, 2010 8:46 am 
Offline
Junior Member

Joined: Tue Jan 01, 2008 4:28 am
Posts: 32
Drupal is indeed the important variable here. 100 MySQL statement/request is a bit of "understatement" -- my Drupal site front page constantly getting > 250 MySQL statements for a logged in user. Lighty itself should have no problem. For my Drupal site, which is also hosted on a 720 (haven't rebooted after Linode upgraded the RAM), does around 200k page views/day. I am using Nginx rather than Lighttpd, and during peak hours it can do up to ~75 req/sec easily, holding around 300 connections (keep alive at around 15 seconds).


Top
   
 Post subject:
PostPosted: Mon Jun 28, 2010 2:38 am 
Offline
Senior Newbie

Joined: Thu Jun 24, 2010 10:07 am
Posts: 18
Thanks so much for your replies :) I'll start testing out the server with an active community and default settings in a few days time, and we'll see how it goes! Appreciate it all, and I'll be sure to come back with any future questions!


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group