Limiting simultaneous php sessions

Problems with the Linux version of XAMPP, questions, comments, and anything related.

Limiting simultaneous php sessions

Postby Geri » 11. March 2013 02:48

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?
Geri
 
Posts: 20
Joined: 02. August 2011 14:10
XAMPP Version: 5.6.3
Operating System: linux

Re: Limiting simultaneous php sessions

Postby Nobbie » 11. March 2013 11:04

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.
Nobbie
 
Posts: 6652
Joined: 09. March 2008 13:04

Re: Limiting simultaneous php sessions

Postby Geri » 12. March 2013 22:15

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.
Geri
 
Posts: 20
Joined: 02. August 2011 14:10
XAMPP Version: 5.6.3
Operating System: linux

Re: Limiting simultaneous php sessions

Postby Geri » 13. March 2013 18:20

done: i had to implement it myself. topic can be closed.
Geri
 
Posts: 20
Joined: 02. August 2011 14:10
XAMPP Version: 5.6.3
Operating System: linux


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 12 guests