locking

Hi @all

On command top I have sometimes a number of locks displayed (eg.46)

How can I find out what these locks are?
 
Please post an example, keep in mind that we can't look at your screen so we have no idea what you're looking at.

Also report the version of FreeBSD.
 
background information:
i see this not very often... but the locks slow down the system .. i post a fake image.. when it happends also the cpu usage of system goes up to 99% and computer is unrespondable (i used cpuset to exclude one or two cores .. then i kill some processes like apache and php .. after this ... the locks goes down 0 and normal cpu usages )

2018-03-15 09_17_51-192.168.220.100 - PuTTY.png
 
Those are probably resource locks. This can happen for example when a process wants more memory but the system doesn't have it any more. As you're running MySQL my first guess would be a badly tuned MySQL which tries to use more memory than the system actually has.
 
Thanks for your advise...
mysqltuner say that MySQL can max use of 5.1 GB ram and max reached is 3.6 GB.. (system has 32 GB)

Can resource locks also can be CPU or filesystem (ZFS) based?

I am not sure, is it the right way find out what these locks are or should I find out what's the high system CPU usage is? It is a chicken <-> egg problem.
 
mysqltuner say that MySQL can max use of 5.1 GB ram and max reached is 3.6 GB.. (system has 32 GB)
Ok, that's good. I've seen some really bad configurations where MySQL was configured to use 100GB while the machine only had 12GB. And that's obviously going to cause problems.
Can resource locks also can be CPU or filesystem (ZFS) based?
It could be anything really. Try and get the actual numbers, not something you remembered, we can probably tell what's what if we have the original output.

I am not sure, is it the right way find out what these locks are or should I find out what's the high system CPU usage is?
I would definitely start there, it's not normal for MySQL to use 99% CPU. So something fishy is going on. Look at the process list of MySQL: SHOW PROCESSLIST;. Look for abnormal queries or queries that have been running a really long time. If the MySQL database is used for some web application take a really good look at that too, SQL-injection problems are common in badly written web applications.
 
Back
Top