sgtpep / woocommerce-1c

Provides data exchange between the WooCommerce plugin for WordPress and the business application "1C:Enterprise 8. Trade Management" (and compatible ones).
https://wordpress.org/plugins/woocommerce-and-1centerprise-data-exchange/
GNU General Public License v3.0
70 stars 41 forks source link

Нереально медленная работа в php-fpm #3

Closed insound closed 8 years ago

insound commented 8 years ago

Начну с того, что даже открытие страницы /wc1c/exchange/ или ?wc1c=exchange? - около 500-900мс. До этого стояла конфа на апаче+нгинксе и там работало все нормально. Сейчас же на железе с двумя e5 и 96гб рам в минуту заполняется 4-6 товаров - что смешно (отключил транзакции и посмотрел)... в рерайтах проблема или в самом php-fpm не понял пока что. Пробывал как через tcp так и через сокет - результат один. По https и без. Есть идеи, почему может так быть?

Конфиг такой у nginx:

(Серверная часть)

location = /favicon.ico {
    log_not_found off;
    access_log off;
}

location = /robots.txt {
    allow all;
    log_not_found off;
    access_log off;
}

location / { try_files /wp-content/w3tc/pgcache/$cache_uri/_index.html $uri $uri/ /index.php?$args ;

    add_header "X-SS-Cache" "w3 total ss-cached";

}

POST requests and urls with a query string should always go to PHP

if ($request_method = POST) { set $cache_uri 'null cache'; }
if ($query_string != "") { set $cache_uri 'null cache'; }

Don't cache uris containing the following segments

if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|/wp-(app|cron|login|register|mail).php|wp-.*.php|/feed/|index.php|wp-comments-popup.php|wp-links-opml.php|wp-locations.php|sitemap(index)?.xml|[a-z0-9-]+-sitemap([0-9]+)?.xml)") { set $cache_uri 'null cache'; }

Don't use the cache for logged in users or recent commenters

if ($http_cookie ~* "commentauthor|wordpress[a-f0-9]+|wp-postpass|wordpress_logged_in") { set $cache_uri 'null cache'; }

location ~* ^.+.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ { access_log off; log_not_found off; expires max; }

    location ~ [^/]\.php(/|$) {
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                                        add_header "X-SS-Cache" "PHP Dynamic";
                                          add_header 'Strict-Transport-Security' 'max-age=15768000; includeSubDomains; preload;';
                                            add_header 'Access-Control-Allow-Origin' "$http_origin";
                                                                  keepalive_timeout 3600;
 proxy_read_timeout 3600s;
proxy_send_timeout 3600s;
fastcgi_read_timeout 3600;
    add_header 'Access-Control-Allow-Credentials' 'true';
    add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
        if (!-f $document_root$fastcgi_script_name) {
            return  404;

        }

        fastcgi_pass    %backend_lsnr%;
        fastcgi_index   index.php;
        include         /etc/nginx/fastcgi_params;
    }

error_page  403 /error/404.html;
error_page  404 /error/404.html;
error_page  500 502 503 504 /error/50x.html;

location /error/ {
    alias   %home%/%user%/web/%domain%/document_errors/;
}

location ~* "/\.(htaccess|htpasswd)$" {
    deny    all;
    return  404;
}

include     /etc/nginx/conf.d/phpmyadmin.inc*;
include     /etc/nginx/conf.d/phppgadmin.inc*;
include     /etc/nginx/conf.d/webmail.inc*;

include     %home%/%user%/conf/web/nginx.%domain%.conf*;

}

ps конфиги нжинкса в гитхабе ад

sgtpep commented 8 years ago

Извините за долгий ответ. Но конфигурация серверов выходит за рамки сферы ответственности плагина. Тем не менее, готов принять от вас исправление плагина или дополнение документации, если проблему удалось решить и она как-то связана с плагином.