Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

一度ブラウザを閉じてから再度アクセスしたときのサーバー負荷が高い #12

Closed
Yuki246ra opened this issue Nov 24, 2022 · 1 comment · Fixed by #13
Assignees
Labels
enhancement New feature or request

Comments

@Yuki246ra
Copy link
Owner

Issue

一度ブラウザを閉じてから再度アクセスしたときのサーバー負荷が高い

原因?

learnrパッケージは、ストレージにセッション情報を記録して再アクセス時に前回作業を再現するので、サーバーでRプロセスが多数走ることになり負荷が高い。

@Yuki246ra Yuki246ra added the enhancement New feature or request label Nov 24, 2022
@Yuki246ra Yuki246ra self-assigned this Nov 24, 2022
Yuki246ra pushed a commit that referenced this issue Nov 24, 2022
@Yuki246ra Yuki246ra mentioned this issue Nov 24, 2022
Yuki246ra added a commit that referenced this issue Nov 24, 2022
@Yuki246ra
Copy link
Owner Author

変更点1

ここを参考に、セッションストレージを無効にするコードをsetupチャンクに追記した。

## start-over-automatically-at-everyaccess
options(tutorial.storage = list(
  # save an arbitrary R object "data" to storage
  save_object = function(tutorial_id, tutorial_version, user_id, object_id, data) {},
  # retreive a single R object from storage
  get_object = function(tutorial_id, tutorial_version, user_id, object_id) {NULL},
  # retreive a list of all R objects stored
  get_objects = function(tutorial_id, tutorial_version, user_id) {list()},
  # remove all stored R objects
  remove_all_objects = function(tutorial_id, tutorial_version, user_id) {}
))

変更点2

tidyverseを開設する目的で開設したのでサーバーサイドでもtidyverseを読み込んでいたが、dplyr, readrなど実際に使用するパッケージに限定して読み込むことにした
(Rセッションを立ち上げる時の速度に影響することを期待した)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant