eddic / fastcgipp

fastcgi++: A C++ FastCGI and Web development platform:
https://fastcgipp.isatec.ca
GNU Lesser General Public License v3.0
310 stars 94 forks source link

Session Problem #57

Closed Yemor closed 6 years ago

Yemor commented 6 years ago

I seem found a problem with the Session Example. Session.fcgi were not share the s_sessions in different process. I had open 25 process to launch the Session.fcgi , When I reflash the Site too fast , the nginx will use other process(because the first process is using) and then the session size is zero in second process.

Yemor commented 6 years ago

Maybe you can solve it by make a shared memory at linux system.

Yemor commented 6 years ago

Thank for your library. It is work successful at one process. I just try to know how to Identify same sid between different process. :P Thank for you help.

Yemor commented 6 years ago

Or maybe we can use Redis to save the session?

eddic commented 6 years ago

The fastcgi++ API is not intended for the application to be spread across multiple instances. The motivation for nginx spawning multiple instances is in response to badly made FastCGI applications not scaling well. Fastcgi++ applications do scale well. The solution to your problem is to modify your nginx configuration to ensure it never spawns more than a single instance.

Yemor commented 6 years ago

Ok, thank for your reply, that is helpful!