Would saving a large array in a PHP session be hard on the server? By "large" array, I mean an array that has perhaps 500 elements with each element having up to 100 fields.
I could have thousands of users doing this process several times / minute.
Would saving a large array in a PHP session be hard on the server? By "large" array, I mean an array that has perhaps 500 elements with each element having up to 100 fields.
I could have thousands of users doing this process several times / minute.
First, a brief intro to session handling in PHP:
When you open a session, a cookie is created that contains the ID of the session, and is sent to the client. PHP will then use the path defined in session.save_path
to save a file using the id as filename ( reference ).
What does that mean in your case? It means you'll be creating an additional bottleneck (disk I/O is one of the slowest things in most setups) because you'll be writing/reading files all the time.
Database servers have tons of code to handle that kind of latency, so it might be very beneficial to just use a table in a database that has your serialized array as a string, keyed by an id in the $_SESSION
.