Darrell Brogdon
Darrell Brogdon

Reputation: 6973

How intensive is PHP's session garbage collection

If I configure session.gc_* such that probability of the GC running is 1% or greater, how intensive is that? Does it slow the site down for the request where garbage collection is happening? If so, is the speed reduction noticeable? Or does it simply increase server load?

Upvotes: 1

Views: 37

Answers (1)

Julie Pelletier
Julie Pelletier

Reputation: 1716

Many systems are configured for garbage collection to never be run during regular requests to overcome the need for fine tuning the timing and to optimize the live requests. They simply set up a cron job that does it every 15-60 minutes.

Note however that regular (even frequent) garbage collection has a very limited impact on performance. The impact is more apparent when done very infrequently.

Upvotes: 2

Related Questions