inVINCEable Posted July 24, 2007 Share Posted July 24, 2007 Kind of a general question but I could not find a concrete answer anywhere. Right now at any given time my site has about 10,000 concurrent users. I make good use of the $_SESSION variable, and use it to do all sorts of things from inserted the user_id stored in the session into hidden fields etc. Right now my concern is I am storing about 30 variables per user in each session. About 20 of these are just basic things like the user's settings. My question is, how much of a performance hit am I taking by storing this many variables in the session? Should I look at possibly moving the user settings to the DB instead? Thanks for any advice on the subject. Quote Link to comment Share on other sites More sharing options...
redarrow Posted July 24, 2007 Share Posted July 24, 2007 i think as long as the session_start() is at the top of every page and the information is kept by the session it fine when they get to the bit where the database needs updating then update as needed. remember to unset all session's when update has be done. Quote Link to comment Share on other sites More sharing options...
tsilenzio Posted July 24, 2007 Share Posted July 24, 2007 Ok from what you said it depends, if each user takes about 10kilobytes worth of settings (mostly strings) stored in a session var then when u mutiply that by 10,000 then it turns into 100megabytes of space on the harddrive which could need to be changed very freaquently so it depends on how fast the PC is and how much ram it has that the server runs on, also i think you should try to use a database as much as possible but im also inexperenced lol (also im sure its more liek numbers and not really long strings just stating worse scenario) Quote Link to comment Share on other sites More sharing options...
inVINCEable Posted July 25, 2007 Author Share Posted July 25, 2007 I see, thank you. Quote Link to comment Share on other sites More sharing options...
dj-kenpo Posted July 25, 2007 Share Posted July 25, 2007 I can't really be of help other than to bump this as it's an issue I think about alot too. there's always a trade off in how many sql calls to make, how much cpu to eat, how much memory to use. I'm curious, with 10k concurrent users, currently with the way you're doing things what sort of drain does thta cause for you, ie what sort of server /plan do you run that from? what type of site is it? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.