56 Replies
Project ID:
N/A
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
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
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 updatingdoes interval use server sent events?
hmm i am not quite sure
how would i check?
you said it works locally, so when running locally check the browsers debug tools in the network tab and look for an open connection
okay okay hang on
this is what i see
look harder
that dash-update-component is i think the interval one
cause it keeps adding
okay now compare that to the same app running on railway, what are the differences
it's very identical
except railway doesn't have reload-hasg
whatever that is
are there any browser console errors
nothing related to the problem
do those two types of errors appear when running locally?
yup
can you send the railway domian?
https://flask-production-5636.up.railway.app/
hang on im just gonna grab lunch
im back
so is it railway limitation orr?
can you show me your service variables
those are the railway variables right
I dont have any
how do you authenticate with the api then
does this work
https://test-service2.up.railway.app
It’s public data
HMMM
i see
flashes
of the debug message
so.. no?
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
no i changed gunicorn's worker to use an async based worker
ohhh
it's almost there i think
just need to update every 1 second
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 herewe just need to make it faster
do we just add workers
gotcha gotcha thanks tho
im gonna look more into gunicorn i guess
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
Gotcha ty!
no problem!
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
what did you set the workers to?
17
or was it 12
nvm i used 12
well if you went from 3 to 12 and it didn't fix it, there's no use in going to 17
yeahh
there's something wrong with your code at this point
but like
locally u saw
it works fine
and don't say
I knew you where gonna say it
hahahahah
it may be hard to believe, but just because something works locally and not on railway, doesn't mean it's railways issue
:0
there are many differences that come with running in a docker container, none of which are railways fault
any other paths i can explore?
I am unfortunately out of ideas, sorry
ty!