Coronium Feedback

Hi,

So if you are using v2.1.1 of the plugin, you can pass an additional parameter to adjust the Corona network timeout.

You can check the plugin version with:

print(core.VERSION)

I have not added it to the docs yet, but you simply add a timeout key to the params_tbl :

core.api.mymethod({ some\_param = "something", timeout = 60 }, myResponseListener)

This also works for core.mysql.* , core.data.* , and core.files.upload

Let me know if that helps. If not then there will also be a server-side adjustment in the next release.

-dev

I’d say if your network calls are timing out on 30s then either your network is shocking or you are simply pushing too much data in a single network call and you need to either 1) not log so much data and/or 2) send smaller packets.

Hi dev,

The plugin auto updates practically daily so, while i just ran the print version to check, it confirmed I’m on 2.1.1  :slight_smile:

Just make sure it ends up in the docs please, i need constant reminders how to do things it seems.

I’ll test it out.

@SGS, you are of course right here and I intend to change the code to split transfers into segments with a max size.

I do not have the issue now, but was provoking it by limiting my upload to 0.1Mbit, trying to see how my code would act up.

Thanks for all input guys!

anaqim

Hi dev,

Discovered something which I cant explain. Tried to google it but nothing conclusive.

Perhaps it is normal and has nothing to do with CC, but in that case excuse my ignorance.

I’m seeing that if I create a network.request loop in sequence (meaning subsequent requests only start after previous request has received a reply), this is processed much faster on my android tablet than on my supercharged PC. The android device runs on WiFi and my PC over LAN, both through the same router.

Is there anyway to explain this and/or should I worry about it?

Thanks in advance for any hints  :slight_smile:

EDIT - think i need to take this to a new thread.

Hi,

There really isn’t anything in Coronium Core that would affect that. Are you running in the Corona simulator on your PC?

-dev

hi, both in the simulator as well as a win32 build.

i made a new thread on the subject and RG replied that he has the same issue with his stuff and that android is simply more efficient on netcalls than windows.

the difference is large though, somehwere between 2 and 3 times faster.

Sorry I forgot to mention that over here.

Hi dev,

I’m stress testing my app a little and notice that the coronium api is giving me some callback errors.

Checking digitalocean error codes, it seems to me that these codes are not from them.

I get the following after sending some 45 requests to do sql.insert, each call made from the client with a 100 ms delay between.

“309 Request rate exceeded”

“250Request rate exceeded”

This is not a concern if this is a limitation on a per user basis, but if it is on a per app/server basis, im in trouble.

Do you know anything about this?

EDIT - Checked the core logs and found this

[error] 1591#0: *147941 limiting requests, excess: 20.170 by zone “apilimit”, client: xx.xx.xx.xx, server: , request: “POST / HTTP/1.1”, host: “xx.xx.xx.xx:10001”

Hi dev,

A second issue just popped up which I’d call a bug.

Your new mysql.insertMany works fine but is unable to handle a single record, something I think it should be able to handle due to the dynamic nature of it all.

Hi,

The limit is per client/IP.

If you’d like to remove or adjust it I can walk you through that.

-dev

Hi,

Thanks for the report. I will take a look at it and make some adjustments.

Go ahead and start new forum topics for new issues/requests. It will make it easier for me to track.  :slight_smile:

I appreciate the feedback!

-dev

Thats a relief  :slight_smile:

From your reply can I assume the reason for this limir is more of a practical nature than technical?

Wouldnt that be possible to have as a variable somewhere, like the network timeout parameter you fixed?

Like “Max API calls per sec” or something

I know I ask a lot but I love your product and cant hold back on opinions.  :stuck_out_tongue:

Hi,

Feedback is the driving force for Coronium, so I’m always open to suggestions.  :slight_smile:

The request limit is there to help mitigate a client from ‘spamming’ the server, either by programmatic mistakes, or otherwise.

Making that dynamic is a little more tricky, but I’ll see what I can some up with. Right now it’s set kind of low, so I might boost it a bit in the next update.

-dev

I see your point.

Perhaps setting the threshold a little higher might be enough, like once per 100 ms might be reasonable or something?

There seem to be an api limit to the size a table can have before triggering an error.

I’ve seen this before when sending in a body using soap, so perhaps it is a related issue.

While it is possible to design a workaround, it would be great if instead the coronium api could automatically split and merge the payload.

EDIT 1 - I am uncertain about this, so will check further and edit this post once conclusive

EDIT 2 - Yes there is a limit and it is very small, much smaller than the soap body.

To clarify, I am sending in a table with about 20 columns.

When using soap body I was able to send in around 1000 rows per call.

With coronium the limit sits somewhere between 20 and 25 rows.

That is a major bump for me, so an automatic api split and merge would be a godsend.

A max string size issue perhaps?

EDIT 3 - Tried it with a table with only a single column, with the same error, so then string length is maybe not the issue?

EDIT 4 - Tried to encode/decode the tables as json in a feeble attempt to see if it matters, but i does not.

This is the log entry:

2017/09/23 08:12:48 [warn] 1596#0: *231 a client request body is buffered to a temporary file /usr/local/coronium/nginx/client_body_temp/0000000015, client: neutralized IP, server: , request: “POST / HTTP/1.1”, host: “neutralized IP:10001”

2017/09/23 08:12:48 [error] 1596#0: *231 lua entry thread aborted: runtime error: [string “coronium.input”]:0: Expected value but found invalid token at character 1

stack traceback:

coroutine 0:

        [C]: in function ‘’

        [string “coronium.input”]: in function ‘request’

        content_by_lua(coronium.locations.conf:111):2: in function <content_by_lua(coronium.locations.conf:111):1>, client: neutralized IP, server: , request: “POST / HTTP/1.1”, host: “neutralized IP:10001”

Hi,

I’ll take a look, could be the client buffer setting in nginx.

Thanks for reporting.

-dev

Hi,

I really would prefer not to have to split up my tables and make separate parallell api calls.

Halted coding until I hear from you on this issue.

Thx!

Hi,

The were a couple issues regarding the temp file that I’ve fixed up. Will be pushing an update a little later today after I add a few other pending changes.

Thanks again for reporting the issue.

-dev

There should be no need to do that after the update.

-dev

Thanks!  :slight_smile:

Hi,

An update is now available here. It should solve your issue. I will also explain a bit later on how to tweak the settings for servers with more memory. Currently I have it set for a baseline installation.

Thanks again for reporting.

-dev