Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How much overhead for PHP sessions managed via session_start()? 2

Status
Not open for further replies.

awaresoft

Programmer
Feb 16, 2002
373
DE
PHP Newbie: Can anyone explain how much overhead using PHP sessions adds to a web application? By PHP sessions I mean PHP's native session capability activated via a session_start() command? (I did some experiments and the overhead seems surprisingly low)

Are PHP native sessions scalable across multiple servers using a database like MySQL?

Any warnings or caveats when using PHP sessions?

Thanks,
Malcolm
 
The overhead is exceptionslly low, all it does is create a little temp file with your saved variables. You can scale it across servers by sharing the tmp directory, but you'd have to rewrite the storage backend to write it to a MySQL database.
 
Eric,

Thanks for your comments. I'm new to PHP (an escapee from the Windows ASP/ASP.NET world) and am blown away with the capabilities I'm discovering with PHP 4.3x, MySQL, and Apache.

My experiments with PHP on a shared hosting provider appear to be almost too good to be true. That's why I've been posting some newbie style questions just to confirm that what I'm seeing is actually true.

Malcolm
 
Yes, you can make a single session available to multiple servers storing session data in MySQL. I posted faq434-2037 after I implemented session storage on MySQL to do that very thing.

Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Sleipnir214,

Thanks for your post. I just read your FAQ and even understand what you're doing!

Malcolm

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top