How to Determine Which CPU The Xojo Cloud Application is Running On

Hi Everyone
I understand that there is one instance of Xojo Cloud ( say Application A) application running on each CPU ( say A1 on CPU1 and A2 on CPU2 for the smallest Xojo Cloud configuration of 2 CPUs)

Is there any way for the application to know to which CPU they are assigned to?
My application keep tracks of connected user to the App level. So since 2 Apps are running concurrently,
the returned value of currently connected user is actually more or less half of the true connected clients.
I am thinking of logging these details to a centralized database. However, its good if i can know which App instance and CPU the user are connected to. Is this possible?

thanks

Each thread of your app can run on a different CPU core.
And they may switch from one core onto another one.

I don’t think you can query this.

I think that Christian is right. I don’t know of a way to query this.

If you are under Linux, and have permission, and determined the PID you want to know about, you can list the core assigned to it as:

ps -o pid,psr -p <pid>

the psr column will be core number.

To get threads , add the -L option (and the lwp column).

Cores:

$ ps -U $USER -o pid,psr,comm | egrep 'myapp|PID'
  PID PSR COMMAND
 3456  1 myapp
 3466  2 myapp
 3444  0 myapp

With threads:

$ ps -U $USER -L -o pid,lwp,psr,comm | egrep 'myapp|PID'
  PID   LWP PSR COMMAND
 3456  3457   2 myapp
 3456  3458   1 myapp
 3456  3459   3 myapp
2 Likes

Thanks for the feedback everyone. For the time being i will log the connected user to a central database for site statistics, excluding the processor info.

1 Like