xiaogengxu / blaufus2021

Other
0 stars 1 forks source link

#oTreeCodeReview #1

Open oTree-org opened 2 years ago

oTree-org commented 2 years ago

Hi! I took a look at this app and my recommendation for now is to leave it on oTree 3. Because it's very intricate and complex and also uses some things like dynamic language selection, which uses internal things from Django that are part of oTree's official API.

If I were to revise the code, my first requirement would be to delete the similar apps. I see these apps:

These apps are very similar so I would recommend deleting all but 1, and then using the copy_app trick here to share the code between apps. However, it seems there are various small differences between the apps, so it would probably take you considerable time to rewrite things and get it working again.

Keeping it on oTree 3 is fine. Just make sure to use the correct version of the documentation for the 'self' format here.

What do you think?

xiaogengxu commented 2 years ago

Hi,

Thanks a lot for reviewing the code and the advice! I've never used copy_app trick. I'll definitely take a look at this trick. The reason I request for the code review is that we got big server problem on Heroku. Our survey contractor sent out more than 1000 invitations. The traffic on Heroku suddenly roared so that the server crashed and people experienced lost connection. I know this is related to the RAM of server (I've increased tier on Heroku). I also wonder how to modify the codes so that the app is more robust to large traffic on Heroku.

When I compared this app with my other apps which I deployed on Heroku and survived same large traffic, this app definitely has larger fraction of Python compared to Html/CSS. My bold guess is that larger fraction of python code would make the app vulnerable to large traffic on Heroku. May I ask your opinion on this issue? It's so appreciated to have your opinion as I have two other apps that will be deployed on Heroku soon.

Br, Xiaogeng Xu

On Sun, Nov 21, 2021 at 6:30 PM oTree-org @.***> wrote:

Hi! I took a look at this app and my recommendation for now is to leave it on oTree 3. Because it's very intricate and complex and also uses some things like dynamic language selection, which uses internal things from Django that are part of oTree's official API.

If I were to revise the code, my first requirement would be to delete the similar apps. I see these apps:

  • deferred
  • immediate
  • matching
  • trial_deferred
  • trial_immediate
  • trial_matching

These apps are very similar so I would recommend deleting all but 1, and then using the copy_app trick here https://www.otreehub.com/projects/otree-snippets/ to share the code between apps. However, it seems there are various small differences between the apps, so it would probably take you considerable time to rewrite things and get it working again.

Keeping it on oTree 3 is fine. Just make sure to use the correct version of the documentation for the 'self' format here https://otree.readthedocs.io/en/self/.

What do you think?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/xiaogengxu/blaufus2020/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHL7WHWVQ3MVATSRP3SVQY3UNENDFANCNFSM5IPKNUIQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

oTree-org commented 2 years ago

I see that this project is using otree==3.0.9, which had issues with RAM spikes. If you upgrade to the latest oTree 3.x with pip3 install -U otree<5 (and update your requirements.txt accordingly), then the memory issues should be fixed.

By the way the copy_app stuff is only for oTree 5.

xiaogengxu commented 2 years ago

Hi,

Thank you very much! It's very important to know. I've upgraded to oTree 3.4.0. Thank you again!

Br, Xu

On Sun, Nov 21, 2021 at 7:15 PM oTree-org @.***> wrote:

I see that this project is using otree==3.0.9, which had issues with RAM spikes. If you upgrade to the latest oTree 3.x with pip3 install -U otree<5 (and update your requirements.txt accordingly), then the memory issues should be fixed.

By the way the copy_app stuff is only for oTree 5.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/xiaogengxu/blaufus2020/issues/1#issuecomment-974857672, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHL7WHU25KGPW2BHMGMO463UNESKTANCNFSM5IPKNUIQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.