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

(12-12-2019, 08:35 AM)blasto333 Wrote: 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.

Do you understand that CI 3 uses "native" sessions?  Do you realize the main purpose of the CI_Session library is to provide database drivers? PHP does not have any built-in ability to use databases. To do that it is necessary to write a custom session handler, i.e. the CI_Session class and its associated drivers.

You cannot solve the locking issue by removing the locks. (Well, you can, but it would be bad practice.) It's not clear to me that's what you have in mind, but if it is read this. If you have read that before then read it again more carefully.
Reply


Messages In This Thread
RE: CI 3 using native sessions instead of driver - by dave friend - 12-12-2019, 09:00 AM



Theme © iAndrew 2016 - Forum software by © MyBB