Coronium causing choppy scene transitions

Hi! Hope someone can give some advice.

I am fine-tuning/debugging atm and have noticed that when my app relies on grabbing information from my EC2 Coronium server (using getMe() and loginUser() etc) it slows down scene transitions and it seems very jumpy and choppy. If I just use the app without logging in or relying on fetching user data, the scene transitions are smooth. 

In my error.log in my Coronium admin it gives me this recurring error: 

uname: write error: Broken pipe

Not sure if it’s related or not but thought it was worth mentioning.

Any advice to help resolve this would be greatly appreciated!

Thanks!

Hi,

Anytime you pull network data, and depending on the size of that data, your app will eat up CPU cycles. This along with a transition – which is CPU intensive itself – will invariably cause some lag, but this isn’t really a direct Coronium issue. It’s more of a structural issue.

But…in this case I will say that the “Broken pipe” error you are getting is often related to multiple Coronium processes running, which could very well be adding to the problem. This will cause a race condition that will throw that error. Also, is it possible that you are spawning multiple instances of Coronium in your app? As opposed to a single “global” instance?

Let me know.

Cheers.

Hi, Thanks for your quick response!

It’s weird because on my simulator there is no lag what so ever. The lag between scenes only exists on my IOs device.

I have only declared mc = require( “mod_coronium” )  once in my main.lua - not in any other scene. I should also mention that I have not used "local = "  when I declared this. Should I?

I also use:

mc:loginUser(userEmailCheck, userPasswordCheck, function( event )

mc:getMe(function(event)

 SOME CODE…

end)

end)

quite a few times in my scenes. 

Let me know if this information helps…

Thanks!

Here is another error in my logs:

2016/08/18 06:44:37 [error] 9484#0: *1572605 lua entry thread aborted: runtime error: /usr/local/coronium/lib/system_api.lua:12: bad argument #1 to ‘gmatch’ (string expected, got nil)
stack traceback:
coroutine 0:
    [C]: in function ‘gmatch’
    /usr/local/coronium/lib/system_api.lua:12: in function ‘cpu_load’
    /usr/local/coronium/lib/system_api.lua:28: in function </usr/local/coronium/lib/system_api.lua:1>, client: 110.143.7.143, server: , request: “POST /system/info/ HTTP/1.1”, host: “ec2-54-206-9-43.ap-southeast-2.compute.amazonaws.com”, referrer: "http://ec2-54-206-9-43.ap-southeast-2.compute.amazonaws.com/admin"
2016/08/18 06:53:31 [error] 9484#0: *1572686 lua entry thread aborted: runtime error: /usr/local/openresty/lualib/mongol/bson.lua:159: bad argument #1 to ‘pairs’ (table expected, got nil)
stack traceback:
coroutine 0:
    [C]: in function ‘pairs’
    /usr/local/openresty/lualib/mongol/bson.lua:159: in function ‘to_bson’
    /usr/local/openresty/lualib/mongol/colmt.lua:276: in function ‘query’
    /usr/local/openresty/lualib/mongol/colmt.lua:337: in function ‘find_one’
    /usr/local/coronium/lib/mod_mongo.lua:126: in function ‘findOne’
    /usr/local/coronium/lib/mod_user.lua:55: in function ‘logIn’
    /usr/local/coronium/lib/login_api.lua:13: in function </usr/local/coronium/lib/login_api.lua:1>, client: 110.143.7.143, server: , request: “GET /1/login? HTTP/1.1”, host: “ec2-54-206-9-43.ap-southeast-2.compute.amazonaws.com
2016/08/18 06:53:34 [error] 9484#0: *1572692 lua entry thread aborted: runtime error: /usr/local/openresty/lualib/mongol/bson.lua:159: bad argument #1 to ‘pairs’ (table expected, got nil)
stack traceback:
coroutine 0:
    [C]: in function ‘pairs’
    /usr/local/openresty/lualib/mongol/bson.lua:159: in function ‘to_bson’
    /usr/local/openresty/lualib/mongol/colmt.lua:276: in function ‘query’
    /usr/local/openresty/lualib/mongol/colmt.lua:337: in function ‘find_one’
    /usr/local/coronium/lib/mod_mongo.lua:126: in function ‘findOne’
    /usr/local/coronium/lib/mod_user.lua:55: in function ‘logIn’
    /usr/local/coronium/lib/login_api.lua:13: in function </usr/local/coronium/lib/login_api.lua:1>, client: 110.143.7.143, server: , request: “GET /1/login? HTTP/1.1”, host: “ec2-54-206-9-43.ap-southeast-2.compute.amazonaws.com
2016/08/18 06:53:35 [error] 9484#0: *1572693 lua entry thread aborted: runtime error: /usr/local/openresty/lualib/mongol/bson.lua:159: bad argument #1 to ‘pairs’ (table expected, got nil)
stack traceback:
coroutine 0:
    [C]: in function ‘pairs’
    /usr/local/openresty/lualib/mongol/bson.lua:159: in function ‘to_bson’
    /usr/local/openresty/lualib/mongol/colmt.lua:276: in function ‘query’
    /usr/local/openresty/lualib/mongol/colmt.lua:337: in function ‘find_one’
    /usr/local/coronium/lib/mod_mongo.lua:126: in function ‘findOne’
    /usr/local/coronium/lib/mod_user.lua:55: in function ‘logIn’
    /usr/local/coronium/lib/login_api.lua:13: in function </usr/local/coronium/lib/login_api.lua:1>, client: 110.143.7.143, server: , request: “GET /1/login? HTTP/1.1”, host: “ec2-54-206-9-43.ap-southeast-2.compute.amazonaws.com
2016/08/18 06:53:37 [error] 9484#0: *1572712 lua entry thread aborted: runtime error: /usr/local/openresty/lualib/mongol/bson.lua:159: bad argument #1 to ‘pairs’ (table expected, got nil)
stack traceback:
coroutine 0:
    [C]: in function ‘pairs’
    /usr/local/openresty/lualib/mongol/bson.lua:159: in function ‘to_bson’
    /usr/local/openresty/lualib/mongol/colmt.lua:276: in function ‘query’
    /usr/local/openresty/lualib/mongol/colmt.lua:337: in function ‘find_one’
    /usr/local/coronium/lib/mod_mongo.lua:126: in function ‘findOne’
    /usr/local/coronium/lib/mod_user.lua:55: in function ‘logIn’
    /usr/local/coronium/lib/login_api.lua:13: in function </usr/local/coronium/lib/login_api.lua:1>, client: 110.143.7.143, server: , request: “GET /1/login? HTTP/1.1”, host: “ec2-54-206-9-43.ap-southeast-2.compute.amazonaws.com
2016/08/18 06:53:37 [error] 9484#0: *1572714 lua entry thread aborted: runtime error: /usr/local/openresty/lualib/mongol/bson.lua:159: bad argument #1 to ‘pairs’ (table expected, got nil)
stack traceback:
coroutine 0:
    [C]: in function ‘pairs’
    /usr/local/openresty/lualib/mongol/bson.lua:159: in function ‘to_bson’
    /usr/local/openresty/lualib/mongol/colmt.lua:276: in function ‘query’
    /usr/local/openresty/lualib/mongol/colmt.lua:337: in function ‘find_one’
    /usr/local/coronium/lib/mod_mongo.lua:126: in function ‘findOne’
    /usr/local/coronium/lib/mod_user.lua:55: in function ‘logIn’
    /usr/local/coronium/lib/login_api.lua:13: in function </usr/local/coronium/lib/login_api.lua:1>, client: 110.143.7.143, server: , request: “GET /1/login? HTTP/1.1”, host: “ec2-54-206-9-43.ap-southeast-2.compute.amazonaws.com
2016/08/18 06:53:39 [error] 9484#0: *1572719 lua entry thread aborted: runtime error: /usr/local/openresty/lualib/mongol/bson.lua:159: bad argument #1 to ‘pairs’ (table expected, got nil)
stack traceback:
coroutine 0:
    [C]: in function ‘pairs’
    /usr/local/openresty/lualib/mongol/bson.lua:159: in function ‘to_bson’
    /usr/local/openresty/lualib/mongol/colmt.lua:276: in function ‘query’
    /usr/local/openresty/lualib/mongol/colmt.lua:337: in function ‘find_one’
    /usr/local/coronium/lib/mod_mongo.lua:126: in function ‘findOne’
    /usr/local/coronium/lib/mod_user.lua:55: in function ‘logIn’
    /usr/local/coronium/lib/login_api.lua:13: in function </usr/local/coronium/lib/login_api.lua:1>, client: 110.143.7.143, server: , request: “GET /1/login? HTTP/1.1”, host: “ec2-54-206-9-43.ap-southeast-2.compute.amazonaws.com
2016/08/18 06:53:40 [error] 9484#0: *1572721 lua entry thread aborted: runtime error: /usr/local/openresty/lualib/mongol/bson.lua:159: bad argument #1 to ‘pairs’ (table expected, got nil)
stack traceback:
coroutine 0:
    [C]: in function ‘pairs’
    /usr/local/openresty/lualib/mongol/bson.lua:159: in function ‘to_bson’
    /usr/local/openresty/lualib/mongol/colmt.lua:276: in function ‘query’
    /usr/local/openresty/lualib/mongol/colmt.lua:337: in function ‘find_one’
    /usr/local/coronium/lib/mod_mongo.lua:126: in function ‘findOne’
    /usr/local/coronium/lib/mod_user.lua:55: in function ‘logIn’
    /usr/local/coronium/lib/login_api.lua:13: in function </usr/local/coronium/lib/login_api.lua:1>, client: 110.143.7.143, server: , request: “GET /1/login? HTTP/1.1”, host: “ec2-54-206-9-43.ap-southeast-2.compute.amazonaws.com
uname: write error: Broken pipe
uname: write error: Broken pipe

Hi,

Anytime you pull network data, and depending on the size of that data, your app will eat up CPU cycles. This along with a transition – which is CPU intensive itself – will invariably cause some lag, but this isn’t really a direct Coronium issue. It’s more of a structural issue.

But…in this case I will say that the “Broken pipe” error you are getting is often related to multiple Coronium processes running, which could very well be adding to the problem. This will cause a race condition that will throw that error. Also, is it possible that you are spawning multiple instances of Coronium in your app? As opposed to a single “global” instance?

Let me know.

Cheers.

Hi, Thanks for your quick response!

It’s weird because on my simulator there is no lag what so ever. The lag between scenes only exists on my IOs device.

I have only declared mc = require( “mod_coronium” )  once in my main.lua - not in any other scene. I should also mention that I have not used "local = "  when I declared this. Should I?

I also use:

mc:loginUser(userEmailCheck, userPasswordCheck, function( event )

mc:getMe(function(event)

 SOME CODE…

end)

end)

quite a few times in my scenes. 

Let me know if this information helps…

Thanks!

Here is another error in my logs:

2016/08/18 06:44:37 [error] 9484#0: *1572605 lua entry thread aborted: runtime error: /usr/local/coronium/lib/system_api.lua:12: bad argument #1 to ‘gmatch’ (string expected, got nil)
stack traceback:
coroutine 0:
    [C]: in function ‘gmatch’
    /usr/local/coronium/lib/system_api.lua:12: in function ‘cpu_load’
    /usr/local/coronium/lib/system_api.lua:28: in function </usr/local/coronium/lib/system_api.lua:1>, client: 110.143.7.143, server: , request: “POST /system/info/ HTTP/1.1”, host: “ec2-54-206-9-43.ap-southeast-2.compute.amazonaws.com”, referrer: "http://ec2-54-206-9-43.ap-southeast-2.compute.amazonaws.com/admin"
2016/08/18 06:53:31 [error] 9484#0: *1572686 lua entry thread aborted: runtime error: /usr/local/openresty/lualib/mongol/bson.lua:159: bad argument #1 to ‘pairs’ (table expected, got nil)
stack traceback:
coroutine 0:
    [C]: in function ‘pairs’
    /usr/local/openresty/lualib/mongol/bson.lua:159: in function ‘to_bson’
    /usr/local/openresty/lualib/mongol/colmt.lua:276: in function ‘query’
    /usr/local/openresty/lualib/mongol/colmt.lua:337: in function ‘find_one’
    /usr/local/coronium/lib/mod_mongo.lua:126: in function ‘findOne’
    /usr/local/coronium/lib/mod_user.lua:55: in function ‘logIn’
    /usr/local/coronium/lib/login_api.lua:13: in function </usr/local/coronium/lib/login_api.lua:1>, client: 110.143.7.143, server: , request: “GET /1/login? HTTP/1.1”, host: “ec2-54-206-9-43.ap-southeast-2.compute.amazonaws.com
2016/08/18 06:53:34 [error] 9484#0: *1572692 lua entry thread aborted: runtime error: /usr/local/openresty/lualib/mongol/bson.lua:159: bad argument #1 to ‘pairs’ (table expected, got nil)
stack traceback:
coroutine 0:
    [C]: in function ‘pairs’
    /usr/local/openresty/lualib/mongol/bson.lua:159: in function ‘to_bson’
    /usr/local/openresty/lualib/mongol/colmt.lua:276: in function ‘query’
    /usr/local/openresty/lualib/mongol/colmt.lua:337: in function ‘find_one’
    /usr/local/coronium/lib/mod_mongo.lua:126: in function ‘findOne’
    /usr/local/coronium/lib/mod_user.lua:55: in function ‘logIn’
    /usr/local/coronium/lib/login_api.lua:13: in function </usr/local/coronium/lib/login_api.lua:1>, client: 110.143.7.143, server: , request: “GET /1/login? HTTP/1.1”, host: “ec2-54-206-9-43.ap-southeast-2.compute.amazonaws.com
2016/08/18 06:53:35 [error] 9484#0: *1572693 lua entry thread aborted: runtime error: /usr/local/openresty/lualib/mongol/bson.lua:159: bad argument #1 to ‘pairs’ (table expected, got nil)
stack traceback:
coroutine 0:
    [C]: in function ‘pairs’
    /usr/local/openresty/lualib/mongol/bson.lua:159: in function ‘to_bson’
    /usr/local/openresty/lualib/mongol/colmt.lua:276: in function ‘query’
    /usr/local/openresty/lualib/mongol/colmt.lua:337: in function ‘find_one’
    /usr/local/coronium/lib/mod_mongo.lua:126: in function ‘findOne’
    /usr/local/coronium/lib/mod_user.lua:55: in function ‘logIn’
    /usr/local/coronium/lib/login_api.lua:13: in function </usr/local/coronium/lib/login_api.lua:1>, client: 110.143.7.143, server: , request: “GET /1/login? HTTP/1.1”, host: “ec2-54-206-9-43.ap-southeast-2.compute.amazonaws.com
2016/08/18 06:53:37 [error] 9484#0: *1572712 lua entry thread aborted: runtime error: /usr/local/openresty/lualib/mongol/bson.lua:159: bad argument #1 to ‘pairs’ (table expected, got nil)
stack traceback:
coroutine 0:
    [C]: in function ‘pairs’
    /usr/local/openresty/lualib/mongol/bson.lua:159: in function ‘to_bson’
    /usr/local/openresty/lualib/mongol/colmt.lua:276: in function ‘query’
    /usr/local/openresty/lualib/mongol/colmt.lua:337: in function ‘find_one’
    /usr/local/coronium/lib/mod_mongo.lua:126: in function ‘findOne’
    /usr/local/coronium/lib/mod_user.lua:55: in function ‘logIn’
    /usr/local/coronium/lib/login_api.lua:13: in function </usr/local/coronium/lib/login_api.lua:1>, client: 110.143.7.143, server: , request: “GET /1/login? HTTP/1.1”, host: “ec2-54-206-9-43.ap-southeast-2.compute.amazonaws.com
2016/08/18 06:53:37 [error] 9484#0: *1572714 lua entry thread aborted: runtime error: /usr/local/openresty/lualib/mongol/bson.lua:159: bad argument #1 to ‘pairs’ (table expected, got nil)
stack traceback:
coroutine 0:
    [C]: in function ‘pairs’
    /usr/local/openresty/lualib/mongol/bson.lua:159: in function ‘to_bson’
    /usr/local/openresty/lualib/mongol/colmt.lua:276: in function ‘query’
    /usr/local/openresty/lualib/mongol/colmt.lua:337: in function ‘find_one’
    /usr/local/coronium/lib/mod_mongo.lua:126: in function ‘findOne’
    /usr/local/coronium/lib/mod_user.lua:55: in function ‘logIn’
    /usr/local/coronium/lib/login_api.lua:13: in function </usr/local/coronium/lib/login_api.lua:1>, client: 110.143.7.143, server: , request: “GET /1/login? HTTP/1.1”, host: “ec2-54-206-9-43.ap-southeast-2.compute.amazonaws.com
2016/08/18 06:53:39 [error] 9484#0: *1572719 lua entry thread aborted: runtime error: /usr/local/openresty/lualib/mongol/bson.lua:159: bad argument #1 to ‘pairs’ (table expected, got nil)
stack traceback:
coroutine 0:
    [C]: in function ‘pairs’
    /usr/local/openresty/lualib/mongol/bson.lua:159: in function ‘to_bson’
    /usr/local/openresty/lualib/mongol/colmt.lua:276: in function ‘query’
    /usr/local/openresty/lualib/mongol/colmt.lua:337: in function ‘find_one’
    /usr/local/coronium/lib/mod_mongo.lua:126: in function ‘findOne’
    /usr/local/coronium/lib/mod_user.lua:55: in function ‘logIn’
    /usr/local/coronium/lib/login_api.lua:13: in function </usr/local/coronium/lib/login_api.lua:1>, client: 110.143.7.143, server: , request: “GET /1/login? HTTP/1.1”, host: “ec2-54-206-9-43.ap-southeast-2.compute.amazonaws.com
2016/08/18 06:53:40 [error] 9484#0: *1572721 lua entry thread aborted: runtime error: /usr/local/openresty/lualib/mongol/bson.lua:159: bad argument #1 to ‘pairs’ (table expected, got nil)
stack traceback:
coroutine 0:
    [C]: in function ‘pairs’
    /usr/local/openresty/lualib/mongol/bson.lua:159: in function ‘to_bson’
    /usr/local/openresty/lualib/mongol/colmt.lua:276: in function ‘query’
    /usr/local/openresty/lualib/mongol/colmt.lua:337: in function ‘find_one’
    /usr/local/coronium/lib/mod_mongo.lua:126: in function ‘findOne’
    /usr/local/coronium/lib/mod_user.lua:55: in function ‘logIn’
    /usr/local/coronium/lib/login_api.lua:13: in function </usr/local/coronium/lib/login_api.lua:1>, client: 110.143.7.143, server: , request: “GET /1/login? HTTP/1.1”, host: “ec2-54-206-9-43.ap-southeast-2.compute.amazonaws.com
uname: write error: Broken pipe
uname: write error: Broken pipe