• 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
session lock problem

#1
i am using ci 3.1.8 and mysql.
mariadb version is 10.3.12 .
i have multiply users, and sometimes query can return long , than all sessions are locked.
i dont want to locked all sessions,i  just want to lock the session which supposed to be
how can i solve this problem
thanks for suggestions.
Reply

#2
@makif,

What do you mean by...and sometimes query can return long? Does the query take a long time to run?
Reply

#3
(01-31-2019, 05:20 PM)php_rocs Wrote: @makif,

What do you mean by...and sometimes query can return long?  Does the query take a long time to run?
yes  thats what i mean. and codeigniter locked sessions,
i know its about get_lock function in library, but why it locked all users sessions. also everything happens normal when query end.
thank you for your replies
Reply

#4
@makif,

I would suggest doing a database analysis to see what tables may need to have indexes added or removed. Test your query to determine why it is slow. Try doing an explain on the query and see where you can improve it.
Reply

#5
(02-01-2019, 03:33 PM)php_rocs Wrote: @makif,

I would suggest doing a database analysis to see what tables may need to have indexes added or removed.  Test your query to determine why it is slow.  Try doing an explain on the query and see where you can improve it.

i did test many times but i dont understand  why it lockes all sessions . i am using php7 and it shouldnot be 
i am running my queries with millions rows , some queries are so complex and it lockes all sessions
thanks for your suggestions
Reply

#6
@makif,

It may be that something is configured wrong. Have you checked your PHP ini file? What version of PHP are you using(7.0.x or 7.1.x or 7.2.x or 7.3.x)? What are you database settings? How long has this been an issue?
Reply

#7
(02-06-2019, 07:13 AM)php_rocs Wrote: @makif,

It may be that something is configured wrong.  Have you checked your PHP ini file?  What version of PHP are you using(7.0.x or 7.1.x or 7.2.x or 7.3.x)? What are you database settings?  How long has this been an issue?

Php 7.1.18
mariadb version is 10.3.12
ci version is 3.1.8
it showed when data increased (exp: 20 million rows, 40 million rows)
i am using master-slave replication . Maybe it can be problem but i should use master-slave.
i will check my php.ini file, 
 
some settings on slave my.ini file
Code:
read_buffer_size = 2M
sort_buffer_size = 8M
join_buffer_size = 8M
query_cache_size = 1M
query_cache_limit = 1M
binlog_format=MIXED
long_query_time = 10
innodb_buffer_pool_size = 8G
[myisamchk]
key_buffer_size = 512M
sort_buffer_size = 512M
read_buffer = 8M
write_buffer = 8M
thank you for your attention
Reply

#8
@makif,

This may be an issue of the queries running to long which is causing the PHP session to lock. This points to a database issue. Have you tested your queries to see how long it takes for them to execute? Have you tried the turning on the Profiler to see what queries have been run and how long they are taking?
Reply

#9
You should also update your PHP, version 7.3.2 is now out.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply

#10
(02-08-2019, 09:18 AM)php_rocs Wrote: @makif,

This may be an issue of the queries running to long which is causing the PHP session to lock.  This points to a database issue.  Have you tested your queries to see how long it takes for them to execute?  Have you tried the turning on the Profiler to see what queries have been run and how long they are taking?

yes i did test and control profile, for example i have datas for 2 years and table has about 120-150 millions rows. User search without giving date and query takes long.  it takes ten minute, sometimes it takes more than ten minutes,  also i use joins, order by desc and limit
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.