Welcome Guest, Not a member yet? Register   Sign In
Memory usage
#1

[eluser]cpass78[/eluser]
Just curious, does this seem a little high to anyone else?
Quote:MEMORY USAGE
4,515,176 bytes

Im the only person using the site right now and there are only to db calls:
Code:
0.0025      SELECT *
FROM (`tbl_sessions`)
WHERE `session_id` = 'xxxxxxxxxxxxxxxx'
AND `ip_address` = 'xxx.xxx.xxx.xxx'
AND `user_agent` = 'Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/2010'
Code:
0.0018      SELECT *
FROM (`tbl_users`)
WHERE `id` = 'x'

Im wondering what will happen when I start to get the traffic that i'm expecting, will the be any problems?
#2

[eluser]pickupman[/eluser]
Using simple math, this isn't as bad as you may think. If your script is using around ~4MB per request, and you had only 256MB ram available, that would be (256 /4.5) 56 concurrent page requests. If each concurrent request takes approx 1.5 secs, you would have the following:
60 secs / 1.5 secs = 40 x 56 = 2,240 pages/min
2,240 / min * 60 min = 134,400 pages/hour

And that's assuming 256MB of available RAM. You should be fine. I used to worry about the same thing, but you still want to make sure you are using more variables or fetching more data than you have to.
#3

[eluser]cpass78[/eluser]
Cool, hadnt thought to do the math that way. Thanks very much for your solution. Im working with 600MB and total execution time is <> 0.0355 so I should be perfectly within range of several hundred thousand p/h.

Thanks again
#4

[eluser]cahva[/eluser]
Memory consumption can be high even for a simple "Hello world" page. For example shared hosts have usually enabled a lot of different extensions for PHP which are always loaded whether you use them or not. If you are in control of the server, you can disable some of the extensions that are not used and it can save a lot of memory. But as Pickupman said, you should be fine and usually theres a lot more memory reserved in todays servers than 256MB Smile




Theme © iAndrew 2016 - Forum software by © MyBB