Looking for elaboration on how sessions are stored for high-traffic sites?

temporary_user_name

I've been trying to understand where PHP (or other languages, really, I suppose the principle is the same) keeps session data server-side.

I read this question and this question, which both seem to indicate that it defaults to just creating ordinary files in the /tmp folder, files whose names match the session IDs stored in client-side cookies.

But that seemed ever so slightly odd to me.....what about high traffic sites with millions of concurrent users....do they really just have a giant folder full of session files? There's no database involved?

Brad

Even on smaller sites, I don't really know that many people putting files in a directory for session storage. It's slow, and session data can be something you need access to quickly and frequently, depending on the site.

Very often, an in-memory data store like Redis will be used. Many of these type of databases enable basic sharding across multiple hosts, and simple forms of replication to enable the scaling of your session storage.

When you get to the scale of millions of concurrent users, your specific needs become much more amplified. How much data do you need to store in session? Can that data be replicated to others on a best-effort basis or must it be atomic? At this point, everyone does it a bit different but the principle is the same. Fast data accessible from everywhere it needs to be. Store as little as you can.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How does Psycopg2 handle sessions and transactions concurrency on high traffic apps?

How to tell whether elaboration has completed at a breakpoint?

TensorFlow in production for real time predictions in high traffic app - how to use?

High traffic hosting provider

How to design React signIn proccess with NodeJS and sessions stored in cookies?

How to disallow TTL refresh for sessions stored through Express-session?

Gorilla sessions stored in localStorage

PHP Sessions not stored

Looking for a high resolution timer

Python - How to search for an object stored in a list, by looking up an attribute of the object

How do the web protection products which intercept SSL traffic using proxy, work with sites implementing SSL pinning?

Can Stargate handle high traffic?

How to find out if an Ada file was compiled using static or dynamic elaboration

Django Migrations - How can I migrate my own django models without any inbuild models like auth,sessions,sites,admin etc

How to sort numbers from high to low without looking if it's negative or positive

High-Availability of Keycloak across remote sites

Right way to manage a high traffic connection application

Ninject thread blocking issue on high traffic site

Got Download Traffic While Uploading With High Speed

Abnormally high network traffic on Ubuntu Bionic

Ignite Semaphore doesn't support high traffic?

High traffic php ajax chat design options

Configuring Fiddler to capture sessions between two local IISExpress sites?

Varnish 4: High cache-hit but high backend traffic

Stored information between browsing sessions - Selenium

asp.net sessions not stored in sql

Looking for customized Scatter plot Graph in High chart

Google analytics not registering my app as a source of traffic to other sites

Looking for faults in algorithm for organizing a one-way railway station traffic