• After a server crash (some opensuse update didn’t go through at all) – I moved my server to another root server. The server is fully overpowered (I7, 32GB Ram, 200mbit connection – hetzner EX4s) and running Ubuntu Server 13.10

    First of all my membership options site wouldn’t load because of Database Connection Error (everything else worked). I solved that by copying all content of it to a new page, and activating that new page as membership options page).. Then the old membership otpions page started working again (as long as I don#t make it again the membership options page)…

    Everything basically works fine now – except that the s2member protected downloads (s2member files folder) trickle in (max 100KB/s). If I download any other files from the server (all .7z files so no caching problems), they work well at 200Mbit (I’ve got a Windows server with 1000Mbit connection for testing that).

    Config is PHP-FPM, Nginx, FastCGI just as before. Where can be the culprit???

    https://www.ads-software.com/plugins/s2member/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter extremecarver

    (@extremecarver)

    Oh actually, the downloads don’t download at all, except if I use Firefox Down Them All Download Manager. Normal Firefox or Chrome Download just crash after a couple of KBs…

    Thread Starter extremecarver

    (@extremecarver)

    managed to activate mcrypt (I think this is only detection problem but was running anyhow): https://askubuntu.com/questions/360646/cant-use-php-extension-mcrypt-in-ubuntu-13-10-nginx-php-fpm

    Thread Starter extremecarver

    (@extremecarver)

    Ohhh, that problem is caused by Fastcgi buffers…
    Somehow in so many tutorials in the net, the descriptions will lead s2member to go havoc:

    fastcgi_buffer_size 128k;
    fastcgi_buffers 4 256k;
    fastcgi_busy_buffers_size 256k;
    fastcgi_temp_file_write_size 256k;

    is very often found when googling fastcgi_buffer and wordpress.
    However fastcgi_buffers 4 256k or even worse increasing it because one thinks, I have so much memory lets increase all buffering to fastcgi_buffers 16 256k will slow down wordpress a bit, and completly disable using the download function.

    Now I set it to:
    fastcgi_read_timeout 60s;
    fastcgi_buffer_size 8k;
    fastcgi_buffers 512 8k;
    fastcgi_connect_timeout 60s;
    fastcgi_send_timeout 60s;
    fastcgi_busy_buffers_size 16k;
    fastcgi_temp_file_write_size 256k;
    fastcgi_intercept_errors on;
    fastcgi_max_temp_file_size 0;

    proxy_buffer_size 16k;
    proxy_buffers 4 16k;

    and that seems to work fine. Twould be nice to have some input on how to really set those buffers best…

    And s2member should check in the s2-server-scanner about the fastcgi buggers or put a warning…

    Thread Starter extremecarver

    (@extremecarver)

    Oh, while the buffer sizes matter a bit – the really important bit is this:
    fastcgi_max_temp_file_size 0;

    Without this line, s2member downloads fail. I wonder why on Opensuse this didn#t happen? Maybe it’s only a problem with php 5.5 or newer Nginx version?

    There needs to be a big warning if nginx is used by s2member to make sure this line exists!!!!

    Or can we maybe block caching of .7z or .exe or .zip files in nginx?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘S2member protected Downloads very Slow’ is closed to new replies.