what would be the limit on the number of session variables?

General discussions related to php

Moderators: macek, egami, gesf

User avatar
javjimb
New php-forum User
New php-forum User
Posts: 12
Joined: Mon Feb 17, 2003 12:44 pm
Location: Germany
Contact:

what would be the limit on the number of session variables?

Postby javjimb » Fri Apr 11, 2003 3:59 pm

hello,

I was just wondering that if one uses sessions then it's the server which is keeping track of all session variables for all users. right?
So if this is the case then if a site is using say 20 session variables(per user), won't this increase the load on the server? keeping this in mind.. what would be the limit on the number of session variables... assuming that each variable is a string of no more than 6 chars.

thanks

User avatar
pootergeist
New php-forum User
New php-forum User
Posts: 191
Joined: Wed Jan 29, 2003 7:11 am
Location: UK
Contact:

Postby pootergeist » Sat Apr 12, 2003 1:08 am

theoretically it would only be governed by the amount of webspace you have and the number of online visitors. realistically you should be looking at other means (perhaps even an entire restructuring of your coding) to accomplish what you want if you are getting anywhere near high levels.

i have heard of people holding 2+MB serialized arrays in sessions before - the case I remember most though had 98% identical data per session, so we persuaded them to work toward the 2% in the session and flatfile a copy of the default 100% to work backwards from.

there really should be a way to code that doesn't need multiple megabytes passed as session data between pages for every user, 'tis just a matter of finding it.

User avatar
javjimb
New php-forum User
New php-forum User
Posts: 12
Joined: Mon Feb 17, 2003 12:44 pm
Location: Germany
Contact:

Postby javjimb » Sat Apr 12, 2003 9:31 am

hi pootergeist,

I am not really using 20 session variables. I was passing six variables throught the query string and after testing it a few times I realized how horrible it looks, that's the reason I considered using sessions for those variables.
So I was just wondering about how big a number of session variables would start to affect the server performance drastically

User avatar
pootergeist
New php-forum User
New php-forum User
Posts: 191
Joined: Wed Jan 29, 2003 7:11 am
Location: UK
Contact:

Postby pootergeist » Sun Apr 13, 2003 12:47 am

they would be a bit faster than passing them through the URL actually. they are well worth spending the time learning - very useful too.


Return to “PHP General”

Who is online

Users browsing this forum: No registered users and 2 guests