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

Joined: Thu Mar 11, 2010 10:42 am
Posts: 15
ICQ: 33922655
Location: Ireland
I'm a geek through and through and as a result having browsed through the community sections here, I love Linode already and I'm not even a customer :D

However I wanted to ask about my likely requirements for a Linode. I'm hoping (for cost reasons) to get away with using a Linode 360. The main purpose of which will be a forum I currently have hosted elsewhere.

The forum current has about 500,000 hits a months (<= 2,000 visits a day). Max concurrent users might be about 50 when busy. I'm looking to runs omething like phpbb3 on a LEMP setup. I should in at current rates be looking at less than 100GB transfer a month. Does this sound feasible on a 360 or should I be looking higher up the scale?

Thanks for your help in advance, I'm looking forward to being a Linode customer.


Top
   
PostPosted: Thu Mar 11, 2010 11:51 am 
Offline
Senior Member

Joined: Sat Mar 28, 2009 4:23 pm
Posts: 415
Website: http://jedsmith.org/
Location: Out of his depth and job-hopping without a clue about network security fundamentals
RoryH wrote:
The forum current has about 500,000 hits a months (<= 2,000 visits a day). Max concurrent users might be about 50 when busy. I'm looking to runs omething like phpbb3 on a LEMP setup.


I've heard of 360s handling more traffic; just be cautious with memory and you should be fine. You are already way ahead of the curve using LEMP as opposed to LAMP, as it's easier to optimize for a low-memory situation.

Also optimize MySQL for the available RAM.

A 540 would give you a touch more breathing room, but you'd probably end up using most of the extra RAM as cache (which isn't a bad thing).

_________________
Disclaimer: I am no longer employed by Linode; opinions are my own alone.


Top
   
 Post subject:
PostPosted: Thu Mar 11, 2010 5:06 pm 
Offline
Senior Newbie

Joined: Tue Mar 11, 2008 4:08 pm
Posts: 8
Feasible, sure, but something to burst with if you're ever slashdotted or just extra RAM so 50 concurrent users aren't hitting the hard disk too hard would lean me towards recommending a 540.

I started with a 540 then dropped down to a 360 when I realised it was too much for my requirements. The downtime wasn't too long and I was refunded to the day for what I didn't use so that's always an option.


Top
   
 Post subject:
PostPosted: Thu Mar 11, 2010 7:54 pm 
Offline
Junior Member

Joined: Tue Jan 01, 2008 4:28 am
Posts: 32
different wrote:
Feasible, sure, but something to burst with if you're ever slashdotted or just extra RAM so 50 concurrent users aren't hitting the hard disk too hard would lean me towards recommending a 540.


Well. It might not actually "burst" in the sense that a pre-fork Apache setup would bring the box to its spiral of death when it gets Slashdotted.

With NginX + fix sized PHP/FastCGI backend, the number of FastCGI processes pretty much caps the maximum amount of memory you are going to use. So when you get slashdotted/dugg, it's just going to be slow (Nginx finding the next available FastCGI backend), but it probably won't kill the box.


Top
   
 Post subject:
PostPosted: Thu Mar 11, 2010 8:27 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
IMHO You'll have no problems, just use the my-small.cnf as a baseline for your mysql configuration.

Using LEMP is a really good idea (personally I still use apache as a back end since it allows me to use caching facilities of apc and mod_wsgi for python, roll on PHP-FPM getting released with the PHP core).

I run a system with a similar number of hits and have no problems.


Top
   
 Post subject:
PostPosted: Fri Mar 12, 2010 9:12 am 
Online
Senior Member

Joined: Fri Jan 09, 2009 5:32 pm
Posts: 634
scotty wrote:
different wrote:
Feasible, sure, but something to burst with if you're ever slashdotted or just extra RAM so 50 concurrent users aren't hitting the hard disk too hard would lean me towards recommending a 540.


Well. It might not actually "burst" in the sense that a pre-fork Apache setup would bring the box to its spiral of death when it gets Slashdotted.

With NginX + fix sized PHP/FastCGI backend, the number of FastCGI processes pretty much caps the maximum amount of memory you are going to use. So when you get slashdotted/dugg, it's just going to be slow (Nginx finding the next available FastCGI backend), but it probably won't kill the box.


A properly configured apache setup would do the same thing.


Top
   
 Post subject:
PostPosted: Fri Mar 12, 2010 12:42 pm 
Offline
Senior Member
User avatar

Joined: Tue Nov 24, 2009 1:59 pm
Posts: 362
glg wrote:
A properly configured apache setup would do the same thing.

Agreed, I have a little happy 360 server (3x25threads apache worker, 25 php fastcgi backends, 30-60 requests/sec) that works in almost constant memory space. Fluctuations aren't larger than 10-15 MB, and I usually have about 200 MB of RAM available to disk cache. In cases of heavy rush, it doubles the number of worker processes (+~20MB physical) and if that's not enough... it just gets slower.

Just a hint if you're gonna use worker and care about the (Mostly Harmless) virtual memory commit readout...
Code:
<IfModule mpm_worker_module>
# ...
    ThreadStackSize 2097152
</IfModule>

Default is 8MB. And theoretically, 1MB should be plenty, but better to err on the side of caution. ;)


Top
   
PostPosted: Fri Mar 12, 2010 2:26 pm 
Offline
Senior Member

Joined: Fri May 02, 2008 8:44 pm
Posts: 1121
RoryH wrote:
about 500,000 hits a months (<= 2,000 visits a day).


Hits and visits are completely different beasts. 2,000 hits a day calculates to less than 2 per minute on average, while 2,000 visits a day would amount to dozens or perhaps hundreds of times more.

In either case, there's no reason a 360 shouldn't be able to handle it, especially with a LEMP setup, provided that: (1) you pay attention to the MySQL configuration, and (2) the active part of your database plus indexes can fit in RAM.

If you're slashdotted, static files will be served by nginx just as efficiently as before, and dynamic requests will simply queue up until a FastCGI process becomes available. The server won't run out of memory, it will just become a little slower than usual due to the CPU and I/O load. (Unless, as mentioned above, MySQL betrays you.)


Top
   
 Post subject:
PostPosted: Sat Mar 13, 2010 11:30 pm 
Offline
Junior Member

Joined: Sat Oct 24, 2009 2:16 pm
Posts: 21
Not sure about phpbb3, but most forum software allow static file building for threads, which should help to reduce mem usage


Top
   
 Post subject:
PostPosted: Sun Mar 14, 2010 11:14 am 
Online
Senior Member

Joined: Fri Jan 09, 2009 5:32 pm
Posts: 634
rsk wrote:
glg wrote:
A properly configured apache setup would do the same thing.

Agreed, I have a little happy 360 server (3x25threads apache worker, 25 php fastcgi backends, 30-60 requests/sec) that works in almost constant memory space. Fluctuations aren't larger than 10-15 MB, and I usually have about 200 MB of RAM available to disk cache. In cases of heavy rush, it doubles the number of worker processes (+~20MB physical) and if that's not enough... it just gets slower.

Just a hint if you're gonna use worker and care about the (Mostly Harmless) virtual memory commit readout...
Code:
<IfModule mpm_worker_module>
# ...
    ThreadStackSize 2097152
</IfModule>

Default is 8MB. And theoretically, 1MB should be plenty, but better to err on the side of caution. ;)


Could you share your whole worker config and how you setup fastcgi?


Top
   
PostPosted: Mon Mar 15, 2010 12:59 pm 
Offline
Senior Newbie

Joined: Thu Mar 11, 2010 10:42 am
Posts: 15
ICQ: 33922655
Location: Ireland
Thanks for the advice guys.

hybinet wrote:
RoryH wrote:
about 500,000 hits a months (<= 2,000 visits a day).


Hits and visits are completely different beasts. 2,000 hits a day calculates to less than 2 per minute on average, while 2,000 visits a day would amount to dozens or perhaps hundreds of times more.


Sorry, I think I may gotten confused alright quoting stats, to clarify:

In the last month:
  • 53,675 visits: 1,731.45 Visits / Day
  • 434,220 page views


Top
   
 Post subject:
PostPosted: Mon Mar 15, 2010 2:56 pm 
Offline
Senior Member
User avatar

Joined: Tue Nov 24, 2009 1:59 pm
Posts: 362
Quote:
Could you share your whole worker config and how you setup fastcgi?


It isn't much.
Note that I don't consider myself an expert by any way, it simply works Good Enough For Me (tm). You will need to pay attention to your rewrite and/or redirect rules so /WhateverFakePath/ is exempted from them.

Code:
<IfModule mpm_worker_module>
    StartServers          2
    MaxClients          150
    MinSpareThreads      25
    MaxSpareThreads      75
    ThreadsPerChild      25
    MaxRequestsPerChild   0
    ThreadStackSize 2097152
</IfModule>

EDIT: Heh, seems that in the meantime these very values appeared in mpm_worker docs as an example. ;)

Code:
        FastCgiConfig \
                -idle-timeout 120 \
                -initial-env PHP_FCGI_CHILDREN=24 \
                -initial-env PHP_FCGI_MAX_REQUESTS=500 \
                -killInterval 100000 \
                -listen-queue-depth 300 \
                -maxClassProcesses 1 \
                -singleThreshold 0
# You will need to pay attention to your rewrite
# and/or redirect rules so /WhateverFakePath/
# is exempted from them.
        AddHandler      php5-fastcgi    .php
        Action          php5-fastcgi    /WhateverFakePath/php-cgi
        Alias                           /WhateverFakePath/php-cgi /usr/bin/php-cgi
        <Location                       /WhateverFakePath/php-cgi>
                Order Deny,Allow
                Deny from All
                Allow from env=REDIRECT_STATUS
                Options ExecCGI
                SetHandler fastcgi-script
        </Location>


Works cool, except for one little PITA you can read about in this thread - that is, a "graceful" Apache reload isn't so graceful, and kills all PHP scripts executing at that very moment sending HTTP 500 to users. With currently available FCGI handlers for Apache there's no workaround, unless one prefers using mod_fcgid and php in "dumb handler" mode without APC.


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


Who is online

Users browsing this forum: No registered users and 2 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