Click to See Complete Forum and Search --> : how much can a server take


Ben2008
08-20-2008, 04:54 PM
Hello,
this is a bit half php half MySql and i do not exactly what title to use, but anyways ...

I plan a heavy application (such as a browsergame) and i want to collect basic informations.

I have planned quite a bit, but i dont know how much i can ask per request.

What is a maximal amount of sql querries per Filerequest or the amount that should not be exceeded.

How much time should a request took.

What size can the session take (maximal recommend??) how much data should i save to the session. Should i cache repeated sql querries to the session or querry the data everytime i need it?

I think that 20 Sql querries per normal request and about 50 sql querries for login / initialization is ok, but i have no experiences with that. So i hope you can tell me some limits, experiences.

I know that it also depends on the server, i do not have a high end performance server and I plan with about 50 - 150 users online at the same time. So we can think of normal hardware - in worst case it is a virtual server with low hardware ...



Here are some of my thoughts:

100 users, each user makes every 5 seconds an action.
That means we have to handle 100 request in 5 seconds or 20 Requests per second.

That just means, there is only 50ms "worktime" left for each request. Thats not really much... So how much PHP and MySql-Querries are 50ms?

I hope you can help me out. Maybe I have some false thoughts

ratcateme
08-20-2008, 11:02 PM
what you are talking about sounds fine but if you are going to have that many users online at once then you might want to consider a better server?

Scott.

davidbalt
08-21-2008, 01:41 AM
MySQL is extremely fast. However, that doesnt' mean you shouldn't make every effort to condense your queries and make sure they are efficient. MySQL manual online has a great section about optimizing SELECT. However, 50ms per request is a little too fast to be realistic. You'll need to use very small transfer sizes, highly threaded apache with no unneeded frills, and maybe even load-balancing. Most people can't even do a ping in 50ms.

Also, I think you may overlooking the real speed implications - while you are correct that 20 requests may be coming in per second, leaving a gap of just 50ms between them, that doesn't really mean that the requests have to be DONE in that time. You should probably have apache set up with 20 spare servers on hand to handle the instantaneous load, but each script can take 200-300 ms to run after that without any noticeable effect on the client side.

Ben2008
08-21-2008, 02:45 AM
allright, i forgot something,
multithreading, If my server can handle multiple requests at the same time. Let's say about 10, then we can afford 50*10 = 500 ms per request. Well that sounds better and "ping" doesn't matter, because it is no "work time" it is just a constant that is additional waiting time for the user.

The last way to ensure the workflow is to upgrade server hardware until it gets fluent --