oTree Forum >

Can I stop Heroku daily dyno restart to make oTree session alive for days?

#1 by cjy2001

Hi all,

I'm ready to launch a large-scale experiment. I have deployed my experiment to Heroku and due to the size of the experiment, I expect it will take a few days to get all the data I want. However, I noticed that there is a daily restart feature on Heroku's dynos, which closes all current sessions and previous data. This is causing me some inconvenience as it means I need to check my data and open a new session every day.

Is there any way to stop the restart of Heroku Dyno? Or is there any way on the oTree side that I can keep a session alive despite a dyno restart?

Thanks for any help!

Best,
Jiayi

#2 by manond

Hey all, 

I am also encountering the same issue and am looking for an answer. :)

Thanks,
Bests,

Manon

#3 by cjy2001

Hi Manon,

I think you just need to switch from the eco dyno to a standard one. I think only eco dyno has the sleep feature.

Best,
Jiayi

#4 by manond

Hey Jiayi,

Thank you for your help. I actually have the Basic dyno and it does not go to sleep at all. However, my room is closed and my database erased at each dyno restart... I asked Heroku Support if this can change if upgrading to Standard 1x or 2x. I'll keep you posted.

Bests,
Manon

#5 by manond

Hey,

Just had the Heroku support, they're telling me the dyno restart should not close the room (but still erase data). I do not know how to keep the room alive... Did you find a solution on your hand? 

Bests,
Manon

#6 by ChristianK

Dyno restarts probably erase the sqlite database. Try a persistent database like postgres.
On heroku, make sure to add Heroku Postgres as an add-on on the resources tab. Verify that it shows "attached as DATABASE". Then run otree resetdb on the run console. Verify that it mentiones "postgres" at the top of the output.

#7 by manond

Hey ChristianK,

Thank you, I did that but have two issues. First, when running otree resetdb, I still am on sqlite (the rest is ok). 

Also, I'd tested my app with several rooms and sessions. Unfortunately, when downloading my data to csv, I miss the variables I created at the participant level (others than the usual). Do you have an idea why? 

Thank you,
Bests,
Manon

Write a reply

Set forum username