Is the timeout error output in the Corona console or something that is in the Coronium Core server log?
-dev
Is the timeout error output in the Corona console or something that is in the Coronium Core server log?
-dev
its being returned from the server side api where i have this code after the sql select query:
if not result then
core.log(err)
return core.error(err)
end
on my device i pop up a nativeAlert showing this error message
I dont know if the server logs are kept on file any longer than what is displayed, or where that file might be stored, but currently the logs i get on screen are only 3 days running.
Hi,
Interestingly enough the Corona network.request has a default of 30 seconds for a network timeout, that is why I am curious if it is coming from the Corona client or not, in which case I can add a timeout parameter to the client plugin.
I wasn’t able to determine from looking through this thread what the exact error message was, can you post it again? The Corona network errors are piped through the same error handler as the server return errors, so I would need to see the exact message to tell where it might be coming from.
-dev
Hi,
So i ran some tests, the 45000 records seem to make it fine to the database, but the timeout is coming from the Corona client. I added a parameter to adjust the timeout and if I increase it to 60 seconds, I no longer get the timeout error.
I will push the updated plugin, but…depending on various factors you might never know what a “good” timeout might be, so breaking up the payloads would still probably be a good idea. You could of course just set a really high timeout value and hope for the best.
-dev
Hi dev,
I just tried to provoked the response by severly limiting my already limited my upload speed, while pusing up one of the largest records, and it took a lot longer than 30 seconds and yet, i got no error.
However, your idea about 60 sec is a good one.
Will you document how I can change it, unless its default?
Thanks for the support!
Hope many more than me get on board with using Coronium Core
That’s interesting. Are you able to recreate the error you were receiving earlier? I’m able to evoke the error when adjusting the timeout on my end.
And yes, will be adjustable and documented of course. The documentation is more for me than anyone really.
-dev
Hi,
In regards to pulling large data, a number of factors could be at play. One could be the proper indexing of the database fields.
There is a setting for the MySQL timeout, and I am adding the ability to adjust that on the server-side module, but that won’t be available until the 2.1.0 release, which I am hoping to deploy by the end of the week.
-dev
I’ll try provoking more tomorrow but I am 90% sure the message was “client timed out”.
I use your documentation all the time
Looking forward to the updates!
Now I am off to bed, its 01:00 AM here and i need may day job to pay the bills.
Cheers!
Anaqim
Hi again, i managed to provoke the time out and it works like this:
Client is sending a large batch of data to my own api on the server (core.api…)
The clientside callback is after some time (probably 30 sec) receiving an event error that says “Timed out”.
Looks like your idea that this may be caused by network.request may be a good one.
anaqim
A question, know if there is a way to implement compression on these transfers?
Would make a big impact on simple strings and arrays, i’d think.
There is also the possiblity to zip payload before uploading but thats a lot of hassle, and i suspec unzipping it doesnt work server side.
Just some thoughts
Something like this perhaps…
It doesn’t appear this was ever implemented so that is probably not going to be a possibility at this time.
Also, pushing such a large payload is kind of an edge case for Coronium Core in general. So that is part of the issue.
Using some other type of compression may be an option, but I would need to research.
-dev
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
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
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.