Page 1 of 1

Limiting simultaneous php sessions

PostPosted: 11. March 2013 02:48
by Geri
hi

is there any way to limit the simultanous php sessions per IP?

i want to allow only maximum two script to be runned per IP address at the same time.
i googled after it, but i havent found any usable add-ons or trick

- except to write own session limiter, that i should include in every php file on begin and exit, but this solution sounds very awfull.

any idea?

Re: Limiting simultaneous php sessions

PostPosted: 11. March 2013 11:04
by Nobbie
You should explain more detailed, because there is no "php session" (what do you mean by that?), as PHP is either a module beyond Apache or is called by Apache via CGI. Anyway, there is always a parent Apache process which triggers the PHP execution.

There is no "pure" PHP Session in a webserver environment.

Also PHP scripts *should* execute very quickly. If a PHP Script takes large amount of time, it should not be executed in an Online Environment, but either on localhost only or as a batch job. So what is the reason for this problem?

P.S.: FInally i cannot resolve how someone can start more than one PHP process in his browser, because normally the browser (and client) whaits for the end of the execution, before triggering any other action.

Re: Limiting simultaneous php sessions

PostPosted: 12. March 2013 22:15
by Geri
not really, php scripts are slow creatures. i host a portal that start to become somewhat huge, so we stresstested the portal (ddos), it turned out that my previous protections are not enough any more, to protect my portal.

after investigating the problem, it turned out, that i need to limit the simultanous php executions to max 2 per ip.

i alreday found a way, to do that, but thats ugly - it would be nice if there would be a solution to do that with an apache module.

Re: Limiting simultaneous php sessions

PostPosted: 13. March 2013 18:20
by Geri
done: i had to implement it myself. topic can be closed.