Welcome Guest, Not a member yet? Register   Sign In
CI 3 using native sessions instead of driver

(12-12-2019, 08:32 AM)dave friend Wrote: You will probably have the same locking issues with the native session extension. You probably need to spend some time figuring out where to use session_write_close() and to adjust the database to handle more connections and release them faster.

Persistent connections will not help.

Give serious consideration to using file-based sessions.

phpredis extension has much finer grain control with locking; so it should perform just as good as mysql GET_LOCK without database load. You can do the following. (microseconds instead of 1 second).

; Should the locking be enabled? Defaults to: 0.
redis.session.locking_enabled = 1
; How long should the lock live (in seconds)? Defaults to: value of max_execution_time.
redis.session.lock_expire = 60
; How long to wait between attempts to acquire lock, in microseconds (µs)?. Defaults to: 2000
redis.session.lock_wait_time = 50000
; Maximum number of times to retry (-1 means infinite). Defaults to: 10
redis.session.lock_retries = 10

My main question though is if I implemented native sessions correctly? Also I cannot use file based sessions as the application is behind a load balancer on multiple web servers.

Messages In This Thread
RE: CI 3 using native sessions instead of driver - by blasto333 - 12-12-2019, 08:35 AM

Theme © iAndrew 2016 - Forum software by © MyBB