Strona główna forum Wsparcie Wydajność, optymalizacja Duże pliki downloadable i timeout

Duże pliki downloadable i timeout

Wszystko o tym, czym każdy zająć się powinien...

Post 1 paź 2013, o 12:46

Posty: 2
Gadu-Gadu: 0

Witam,
Mam serwis oparty na Magento 1.7.22 udostępniający duże pliki ok. 4GB. Mam włączonego SSL
Gdy np. dwie osoby pobierają na raz to pojawia mi się timeout. Zasobów mi raczej nie brakuje (łącze 200mb/s, I7, 32GB Ramu, dyski Sata3, postawione na Nginx + php-fpm + APC), myślę że to kwestia samego Magento albo konfiguracji np. php lub samego Nginxa, problem też w tym że nie wiem jak to zdebugować - wydaje mi się że wyczerpałem wszystkie pomysły. Dla plików w downloadable dorzuciłem throttling jak to widać w konfiguracji poniżej. Ktoś wie gdzie szukać problemu ?

Oto moja konfiguracja główna nginxa i vhosta:

user www-data;
worker_processes 8;
pid /run/nginx.pid;

events {
        worker_connections 1024;
        multi_accept on;
        use epoll;
}

http {
        ##
        # Basic Settings
        ##
        #aio on;
        #directio 4m;
        #output_buffers 1 512k;
        sendfile off;
        #fastcgi_max_temp_file_size 0;

        tcp_nopush on;
        tcp_nodelay on;
        keepalive_timeout 15;
        types_hash_max_size 2048;
        server_tokens off;
        client_max_body_size 1m;

        limit_conn_zone $binary_remote_addr zone=addr:10m;

        # server_names_hash_bucket_size 64;
        # server_name_in_redirect off;

        include /etc/nginx/mime.types;
        default_type application/octet-stream;

        ##
        # Logging Settings
        ##

        access_log /var/log/nginx/access.log;
        error_log /var/log/nginx/error.log;

        ##
        # Gzip Settings
        ##

        gzip on;
        gzip_disable "msie6";

         gzip_vary on;
         gzip_proxied any;
         gzip_comp_level 1;
         gzip_buffers 16 8k;
         gzip_http_version 1.1;
         gzip_types text/plain text/css application/json application/x-javascript text/xml application/xm$

        ##
      

        include /etc/nginx/conf.d/*.conf;
        include /etc/nginx/sites-enabled/*;


        map $scheme $fastcgi_https {
        default off;
        https on;
        }

}


######################################## VHOST ##############################################


server {

    listen 80;
    listen 443 ssl;
    ssl_certificate     /etc/ssl/certs/ssl-bundle.crt;
    ssl_certificate_key /etc/ssl/certs/server.key;

    ## ssl_session_timeout 7m;
    ## Specify your SSL options here
    ssl_protocols SSLv2 SSLv3 TLSv1;
    ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
    ssl_prefer_server_ciphers on;

    server_name domain.com  cdn.domain.com;
    server_name js.domain.com;
    server_name media.domain.com;
    server_name skin.domain.com;

    root /var/www/domain.com;


    location / {
        index index.html index.php; ## Allow a static html file to be shown first
        try_files $uri $uri/ @handler; ## If missing pass the URI to Magento's front handler
        expires max;
    }

    location /downloadable/download/ {
       gzip off;
       limit_conn addr 3;
       limit_conn_status 503;
       limit_rate_after 4m;
       limit_rate 3m;
       try_files $uri $uri/ @handler; ## If missing pass the URI to Magento's front handler
  }

    ## These locations would be hidden by .htaccess normally
    location /app/                { deny all; }
    location /includes/           { deny all; }
    location /lib/                { deny all; }
    location /media/downloadable/ { deny all; }
    location /pkginfo/            { deny all; }
    location /report/config.xml   { deny all; }
    location /var/                { deny all; }
    location /var/export/ {
        auth_basic           "Restricted";
        auth_basic_user_file /var/www/domain.com/.htpasswd;
        autoindex            on;
    }

    ## Disable .htaccess and other hidden files
    location ~ /\. {
        deny all;
        access_log off;
        log_not_found off;
    }
    location @handler { ## Magento uses a common front handler
        rewrite / /index.php;
      
      }
      
          location ~ \.php/ { ## Forward paths like /js/index.php/x.js to relevant handler
        rewrite ^(.*\.php)/ $1 last;
    }
    location ~ \.php$ { ## Execute PHP scripts
        if (!-e $request_filename) { rewrite / /index.php last; } ## Catch 404s that try_files miss
        expires        off; ## Do not cache dynamic content
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_read_timeout 150;
        fastcgi_param HTTPS $fastcgi_https;
        #fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        fastcgi_param  MAGE_RUN_CODE default; ## Store code is defined in administration > Configuration $
        fastcgi_param  MAGE_RUN_TYPE store;
        include        fastcgi_params; ## See /etc/nginx/fastcgi_params
    }

}



Duże pliki downloadable i timeout

PostTeraz jest 29 mar 2024, o 11:48
Google

Posty: 427
Lokalizacja: Internet


Posty: 1575
Gadu-Gadu: 0

musisz szukać odpowiedzi raczej w fastcgi i/lub php
raczej to nie wina nginx-a
wszystko zależny od tego jaki to jest też timeout
hosting-magento.pl / magentohosting.eu - szybki hosting Magento
https://www.mage24.pl/ - twój sklep Magento 2 w 5 minut


Powrót do Wydajność, optymalizacja