/    Sign up×
Community /Pin to ProfileBookmark

how much can a server take

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

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@ratcatemeAug 21.2008 — 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.
Copy linkTweet thisAlerts:
@davidbaltAug 21.2008 — 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.
Copy linkTweet thisAlerts:
@Ben2008authorAug 21.2008 — 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 --
×

Success!

Help @Ben2008 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...