containarized shinyproxy非常に遅いです

nybre:

私は、スタックを使用してshinyapps展開:R、ドッキングウィンドウ、およびshinyproxyを、これまでのツールは幸せなユーザーとの偉大されています。しかし、負荷が私はスケールと私はソリューションの更新を実行するときに、ユーザーの手を煩わせる停止することができるようにバランスをとると少し苦労しています。

以下からのアドバイスでhttps://www.shinyproxy.io/shinyproxy-containers/、私はプロセスが、使用して行ってきましたhttps://github.com/openanalytics/shinyproxy-config-examples/tree/master/02-containerized-docker -Engineコンテナドッカエンジンを。私はコンテナにないのjava -jar shinyproxy-2.0.3.jarを実行したときに私のソリューションは、完全に実行されます。私はそれをcontainerizeときしかし、今、それは、非常に非常に遅くなることが、私はそれらをオープンしようとしたときも、内部ネットワークのアクティブなコンテナのクラッシュとInfactはして取得します。

現時点では私はちょうど私の問題を与えることなくが、失敗にshinyproxy缶作業をcontainerizing場合、テストしようとしています。

サーバー上の私のnginxの設定

server {

        root /var/www/html;

        # Add index.php to the list if you are using PHP
        index index.html index.htm index.nginx-debian.html;

        server_name qnumsolutions.com www.qnumsolutions.com;

        location / { 
       proxy_pass          http://127.0.0.1:8080/;

       proxy_http_version 1.1;
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection "upgrade";
       proxy_read_timeout 600s;

       proxy_redirect    off;
       proxy_set_header  Host             $http_host;
       proxy_set_header  X-Real-IP        $remote_addr;
       proxy_set_header  X-Forwarded-For  $proxy_add_x_forwarded_for;
       proxy_set_header  X-Forwarded-Protocol $scheme;
        }

    listen [::]:443 ssl ipv6only=on; # managed by Certbot
    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/qnumsolutions.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/qnumsolutions.com/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}

Shinyproxy application.yml

proxy:
  title: The Operational Intelligence Solution
  logo-url: http://qnum.co.za/wp-content/uploads/2018/03/OI-Solution-Icon.png
  landing-page: /
  heartbeat-rate: 100000
  heartbeat-timeout: 600000
  port: 8080
  authentication: simple 
  container-log-path: ./container-logs
  admin-groups: admin
  usage-stats-url: http://159.65.95.235:8086/write?db=shinyproxy_usagestats
  # Example: 'simple' authentication configuration
  users:
  - name: [email protected]
    password: prupr1.
    groups: admin
  docker:
    url: http://localhost:2375
    port-range-start: 20000
  specs:
  - id: OISolution1
    description: Application is designed to help organisations use advanced analytics to manage product visibility and variance
    container-cmd: ["R", "-e shiny::runApp('/root/hostedoi')"]
    container-image: oisolution
    container-volumes: ["/home/shiny/database:/mnt/persistent1"]
    access-groups: admin
  - id: OISolution2
    description: Application is designed to help organisations use advanced analytics to manage product visibility and variance
    container-cmd: ["R", "-e shiny::runApp('/root/hostedoi1')"]
    container-image: oisolution1
    container-volumes: ["/home/shiny/database:/mnt/persistent1"]
    access-groups: admin

logging:
  file:
    shinyproxy.log

Dockerfile

FROM openjdk:8-jre

RUN mkdir -p /opt/shinyproxy/
RUN wget https://www.shinyproxy.io/downloads/shinyproxy-2.0.3.jar -O /opt/shinyproxy/shinyproxy.jar
COPY application.yml /opt/shinyproxy/application.yml

WORKDIR /opt/shinyproxy/
CMD ["java", "-jar", "/opt/shinyproxy/shinyproxy.jar"]

そして最後にドッキングウィンドウのPS収率をSUDO

CONTAINER ID        IMAGE               COMMAND                  CREATED              STATUS              PORTS                    NAMES
bc396c8bd26a        ois-shinyproxy      "java -jar /opt/shin…"   About a minute ago   Up About a minute   0.0.0.0:8080->8080/tcp   clever_beaver

私が相談追加リンク:https://fly.io/articles/load-balancing-a-fleet-of-docker-containers-using-fly/

あなたの支援をいただければ幸いです。

bellackn:

あなたに問題があるように思えますusage-stats-urlたぶん、ファイアウォールや何かが、この宛先に到達するためにShinyProxyを防ぎますか?私は、この遅い動作を再現することができますが、私はこの行をコメントしたときにそれが姿を消しました。

それに加えて、自分の中にいくつかのミスがあるapplication.ymlに関するドッカーが。私はそれを少し変更し、この構成では私のローカルマシン上でそれを実行するために管理(nginx.confとDockerfileはわずかのための私のニーズに合うように変更されましたdocker-compose):

proxy:
  title: The Operational Intelligence Solution
  logo-url: http://qnum.co.za/wp-content/uploads/2018/03/OI-Solution-Icon.png
  landing-page: /
  heartbeat-rate: 100000
  heartbeat-timeout: 600000
  port: 8080
  authentication: simple 
  container-log-path: ./container-logs
  admin-groups: admin
  #usage-stats-url: http://159.65.95.235:8086/write?db=shinyproxy_usagestats
  # Example: 'simple' authentication configuration
  users:
  - name: [email protected]
    password: prupre35A21.
    groups: admin
  docker:
    internal-networking: true
  specs:
  - id: 01_hello
    display-name: Hello Application
    description: Application which demonstrates the basics of a Shiny app
    container-cmd: ["R", "-e", "shinyproxy::run_01_hello()"]
    container-image: openanalytics/shinyproxy-demo
    container-volumes: ["/tmp:/mnt/persistent1"]
    container-network: shinyproxy_slow_default
    access-groups: admin
  - id: 06_tabsets
    container-cmd: ["R", "-e", "shinyproxy::run_06_tabsets()"]
    container-image: openanalytics/shinyproxy-demo
    container-volumes: ["/tmp:/mnt/persistent1"]
    container-network: shinyproxy_slow_default
    access-groups: admin

logging:
  file:
    shinyproxy.log

私はすべてを走ったdocker-compose、以下を参照してください。

version: "3.1"

services:
  web:
    image: nginx:alpine
    ports:
      - 80:80
      - 443:443
    volumes:
      - ./nginx.conf:/etc/nginx/conf.d/default.conf


  shinyproxy:
    image: sp_test
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - ./application.yml:/opt/shinyproxy/application.yml

おすすめ

転載: http://43.154.161.224:23101/article/api/json?id=205983&siteId=1