manage irregular web traffic: peaks and quiet
My question is about dealing with linode ressource on my web server : it's an apache / tomcat / mysql based on debian 6 - 512.
We begun a few weeks ago a web app which has the following caracteristics of use :
During most of the time, there is not a lot of traffic (<300 visit/day) and not a lot write on db (few site update).
But in fews hours (<4h) some days (one by week, we know when before) there are simultaneously a lot of database update and a lot of traffic (>1000 visits seacking fresh info - and will probably grow up soon) - caching is not possible.
The speed and the lightness of the app is important because (at least) a lot traffic comes from mobile devices.
So I look carrefully optimisation and decided to add also linode Extra to handle better simultaneaous connections for hot peaks periods.
Just for the period then remove the Extra (in summary : more ram to increase securely 'maxClients' through layers [it's prefork apache based in front]) - which means operations on linode manager and a linode boot.
for now I plan to go on like this because the result looks good.
Is that the best way to do it, does anyone has any advice in such case ?
Thanks
2 Replies
I'd look at scaling horizontally for peak loads: move the database off to its own server so that there's no dynamic data on the web servers, then deploy more when the need arises. Use NodeBalancer or your own front-end load balancing solution of choice to route requests. Also, no downtime required to add additional resources.
This does mean you have an additional database server and a NodeBalancer deployed all the time (increasing MRC), but it does make things quite smooth.
I set up apache in front with the first goal of serving most of the static ressources and for further architecture evolutions.
But I (am) was not 'informed' enough to chose between prefork or others, and don't see the real gains in our case (I may be wrong).
We disable most of apache unused module : each apache process take about 2.8m (with a maxClient at 50, reqtimeout 2s, and Extra ram of 90 set for peaks - next time I'll set 180 for peaks).
For now, from the global projet point of view, (at the very begining i said), we are looking carrefully the cost of all things..
The points you tell me, which are relevant, will be carrefully studied.
note : I've spent some times looking at some cloud solutions, runing the 'same' web app (on app engine, Amazone, jelastic…), regarding this particular irregularity, but wasn't fully convinced.
it's fine on linode, thanks again.