[MDEV-9760] mariadb 10.1 Could add OS Process ID Column In Show Processlist ? Created: 2016-03-18  Updated: 2017-01-12  Resolved: 2017-01-12

Status: Closed
Project: MariaDB Server
Component/s: Admin statements
Fix Version/s: N/A

Type: Task Priority: Major
Reporter: sysdljr Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-6756 map a linux pid (child pid) to a conn... Closed

 Description   

Hi,
In order to analyze the application performance , we want to get Process ID in Show Processist, But only have TID field, not found PID field in MariaDB 10.1 .
Today , Download mysql 5.7.11 to Test , It have PID field In show processlist .
Wish to Add PID field in the future MariaDB 10.1 version. Thanks



 Comments   
Comment by Sergei Golubchik [ 2016-03-18 ]

Unfortunately, we cannot do it in 10.1. 10.1 is already GA and as a rule we don't add new features to GA versions.

And 5.7 does not have PID in the show processlist, I've just checked. It does show client's PID in the performance schema, though that value cannot be truly trusted.

Comment by sysdljr [ 2016-03-18 ]

Thank you

Comment by Daniel Black [ 2016-10-24 ]

in MDEV-6756 sanja says `ps -eL -o tid,pid,command` shows the thread on Linux. Is this sufficient?

Comment by sysdljr [ 2017-01-11 ]

Thank you.
@Daniel Black, What I mean is this, please help, thank.
client OS : windows 7 ip: 172.28.14.111
db OS: linux ip: 172.28.14.115

on 172.28.14.111 execute , os pid is : 92868
mysql -uroot -p -h 172.28.14.115

on 172.28.14.115 , show processlist show 172.28.14.111 tid = 1597

execute: ps -eL -o tid,pid,command | grep "1597", show pid 17011,
How can show windows OS's PID 92868 ?

1597 17011 /usr/sbin/mysqld --basedir=/usr --user=mysql --log-error=/log/log.err --port=3306

Comment by Daniel Black [ 2017-01-11 ]

The information as to what the pid is of the client process isn't available on the server as a) it's not transported over the protocol and b) its not accessible to any system or library function call. On b) there is no way a computer can determine anything about a remote tcp connection beyond what is required to maintain the connection. I.e. it cannot determine the OS, the users on that system or anything about the connecting process including the processid.

To provide the PID of the client it would require a protocol change for every client library to include this when communicating to the server. This extends far beyond the scope of what MariaDB server aims to provide and introduces potential compatibility problems with MySQL.

I suggest to meet this requirement, you alter the SQL queries you send to the server to be of the form "SELECT /* pid=92968 */ .... ". By placing this information in the SQL, a SHOW PROCESS list will be able to determine the client process id. If you are using the query cache I recommend enabling query_cache_strip_comments.

Comment by sysdljr [ 2017-01-11 ]

Thank you for your patience and kind support.. I understand.

Comment by Daniel Black [ 2017-01-11 ]

You're welcome. Are you happy for this task to be closed?

Comment by sysdljr [ 2017-01-12 ]

ok, it can closed.

Comment by Daniel Black [ 2017-01-12 ]

Thanks - closing. Ideas are welcome. Sorry implementing this one wasn't really practical and I hope the alternative is acceptable to you.

Comment by sysdljr [ 2017-01-12 ]

Never mind, can acceptable.
Thank you again.

Generated at Thu Feb 08 07:37:07 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.