mysql database/server load question
I googled the crap out of this and curious if any of my DD buddies have an answer to this:
I am developing an application for around 300-500 users, on the home page there are notification/alert boxes (8 to be exact) and I have coded ajax to run a database query for new notifications/alert's every 15 seconds... So potentially 4,000 queries every 15 seconds if everyone is logged in [which is possible for this client].
I'm not sure if server information helps but here's what I'm working with:
Apache version 2.2.22
PHP version 5.2.17
MySQL version 5.1.56
Operating system: linux
Thanks for your responses!
Last edited by crobinson42; 03-04-2012 at 03:30 PM.
the number of requests is more of a host issue than a server issue. Any good web host has servers that could handle that number of requests, but most would also throttle back when confronted with that many requests.
another thing to consider is your bandwidth. that will probably be overwhelmed before apache is.
talk to your hosting company about it. They know their servers and policies better than you or I do. (I think it's likely they'd want you to move to a (virtual) private server.)
mysql might be a bigger problem - you have "only so many" (the default is 100 or 151, but again, many hosts limit this further or divide the connections among accounts on a shared server) concurrent DB connections available, and they don't recycle immediately after being used.
cache results where you can. this could be very useful if there are only a few unique queries. for example, have a cron job run every 15 seconds and write the query results to a text file, and have your AJAX calls query that file instead of the database.
Without knowing more specifics, that's all I could say.
The Following User Says Thank You to traq For This Useful Post:
Thanks, I appreciate the input, and definately the cache idea with a txt file, i've never thought of that!
You're welcome, good luck