R
Railway2y ago
Jed

components not updating every second (DASH)

hi
56 Replies
Percy
Percy2y ago
Project ID: N/A
Jed
JedOP2y ago
N/A So i am using a dcc.interval dash component that fires every 1 second to update my components i will share a video wherein the local updates it but the remote doesn;t
Jed
JedOP2y ago
Jed
JedOP2y ago
as you can see the local file shows my print messages vs the remote which doesn't do anything this is the code responsible for that
Jed
JedOP2y ago
Jed
JedOP2y ago
Jed
JedOP2y ago
so basically every second the update_debug_ouput is called because of the interval and then it outputs (debug_output) to the div with id = debug-output I have tried increasing interval with worry that railway can't handle it but even with a 10 second interval, my other component is not updating
Brody
Brody2y ago
does interval use server sent events?
Jed
JedOP2y ago
hmm i am not quite sure
Jed
JedOP2y ago
how would i check?
Brody
Brody2y ago
you said it works locally, so when running locally check the browsers debug tools in the network tab and look for an open connection
Jed
JedOP2y ago
okay okay hang on this is what i see
Jed
JedOP2y ago
Brody
Brody2y ago
look harder
Jed
JedOP2y ago
that dash-update-component is i think the interval one cause it keeps adding
Jed
JedOP2y ago
Brody
Brody2y ago
okay now compare that to the same app running on railway, what are the differences
Jed
JedOP2y ago
it's very identical
Jed
JedOP2y ago
Jed
JedOP2y ago
except railway doesn't have reload-hasg whatever that is
Brody
Brody2y ago
are there any browser console errors
Jed
JedOP2y ago
nothing related to the problem
Jed
JedOP2y ago
Brody
Brody2y ago
do those two types of errors appear when running locally?
Jed
JedOP2y ago
yup
Brody
Brody2y ago
can you send the railway domian?
Jed
JedOP2y ago
https://flask-production-5636.up.railway.app/ hang on im just gonna grab lunch im back so is it railway limitation orr?
Brody
Brody2y ago
can you show me your service variables
Jed
JedOP2y ago
those are the railway variables right I dont have any
Brody
Brody2y ago
how do you authenticate with the api then does this work https://test-service2.up.railway.app
Jed
JedOP2y ago
It’s public data HMMM i see flashes of the debug message
Brody
Brody2y ago
so.. no?
Jed
JedOP2y ago
i mean at least it's displaying vs not displaying at all but yeah still not the intended how did u do it did u lessen the interval seconds or smth
Brody
Brody2y ago
no i changed gunicorn's worker to use an async based worker
Jed
JedOP2y ago
ohhh it's almost there i think just need to update every 1 second
Brody
Brody2y ago
Procfile: web: gunicorn --worker-class=gevent --worker-connections=1000 --workers=3 main:server and added gevent==22.10.2 to the requirements.txt file ill let you take over from here
Jed
JedOP2y ago
we just need to make it faster do we just add workers gotcha gotcha thanks tho im gonna look more into gunicorn i guess
Brody
Brody2y ago
services on railway's dev plan have 8 cores, so the max workers you could set that to would be 17. but i highly highly doubt that the number of workers is the issue
Jed
JedOP2y ago
Gotcha ty!
Brody
Brody2y ago
no problem!
Jed
JedOP2y ago
yep tried to max the workers didn't work but it did increase the frequency of the debug text appearing hmmm is it maybe because i have lots of threads? i am using 10 threads to calculate the stuff
Brody
Brody2y ago
what did you set the workers to?
Jed
JedOP2y ago
17 or was it 12 nvm i used 12
Brody
Brody2y ago
well if you went from 3 to 12 and it didn't fix it, there's no use in going to 17
Jed
JedOP2y ago
yeahh
Brody
Brody2y ago
there's something wrong with your code at this point
Jed
JedOP2y ago
but like locally u saw it works fine
Brody
Brody2y ago
and don't say I knew you where gonna say it
Jed
JedOP2y ago
hahahahah
Brody
Brody2y ago
it may be hard to believe, but just because something works locally and not on railway, doesn't mean it's railways issue
Jed
JedOP2y ago
:0
Brody
Brody2y ago
there are many differences that come with running in a docker container, none of which are railways fault
Jed
JedOP2y ago
any other paths i can explore?
Brody
Brody2y ago
I am unfortunately out of ideas, sorry
Jed
JedOP2y ago
ty!
Want results from more Discord servers?
Add your server