# Slow mp4 buffer over SSL!

**URL:** <https://www.ruby-forum.com/t/slow-mp4-buffer-over-ssl/243726>\
**Category:** NGINX\
**Created:** [December 27, 2015, 7:36pm UTC](https://www.ruby-forum.com/t/slow-mp4-buffer-over-ssl/243726 "2015-12-27T19:36:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sadaf\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@Sadaf\_N](https://www.ruby-forum.com/u/Sadaf_N)\
**Post date:** [December 27, 2015, 7:36pm UTC](https://www.ruby-forum.com/t/slow-mp4-buffer-over-ssl/243726/1 "2015-12-27T19:36:55Z")

</div>

Hi,

We’ve shifted our static content to SSL recently and found that mp4  
streaming is drastically slow over SSL ( around 90KBps on 4Mbps  
connection)  
and if we test the same video over HTTP it gives us full 400+KBps speed.  
Here is the SSL config :

server {  
listen 443 spdy;  
ssl on;  
server\_name [cw004.domain.net](http://cw004.domain.net) [www.cw004.domain.net](http://www.cw004.domain.net);  
ssl\_certificate /etc/ssl/certs/domain/domain-combined.crt;  
ssl\_certificate\_key /etc/ssl/certs/domain/domain.key;  
ssl\_protocols TLSv1 TLSv1.1 TLSv1.2;  
ssl\_ciphers  
'ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-A$  
location / {  
root /videos;  
index index.html index.htm index.php;

}  
location ~ .(flv)$ {  
flv;  
root /videos;  
expires 7d;  
include hotlink.inc;  
}

```
            include thumbs.inc;

```

#location ~ .(jpg)$ {

# root /videos;

# try\_files $uri /files/thumbs/no\_thumb.jpg;

# }

```
    location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
            expires 1y;
            log_not_found off;
    }

```

You have new mail in /var/mail/root  
[root@cw004 /usr/local/etc/nginx/vhosts]# ^C  
[root@cw004 /usr/local/etc/nginx/vhosts]# cat virtual-ssl.conf  
server {  
listen 443 spdy;  
ssl on;  
server\_name [cw004.domain.net](http://cw004.domain.net) [www.cw004.domain.net](http://www.cw004.domain.net);  
ssl\_certificate /etc/ssl/certs/domain/domain-combined.crt;  
ssl\_certificate\_key /etc/ssl/certs/domain/domain.key;  
ssl\_protocols TLSv1 TLSv1.1 TLSv1.2;  
ssl\_ciphers  
‘ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:DES-CBC3-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4’;  
ssl\_prefer\_server\_ciphers on;  
location / {  
root /videos;  
index index.html index.htm index.php;

}  
location ~ .(flv)$ {  
flv;  
root /videos;  
expires 7d;  
include hotlink.inc;  
}

```
            include thumbs.inc;

```

#location ~ .(jpg)$ {

# root /videos;

# try\_files $uri /files/thumbs/no\_thumb.jpg;

# }

```
    location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
            expires 1y;
            log_not_found off;
    }

    location ~ \.(mp4)$ {
            mp4;
         mp4_buffer_size 4M;
            mp4_max_buffer_size 10M;
            expires 1y;
            add_header Cache-Control "public";
            root /videos;
            include hotlink.inc;
            }

```

# pass the PHP scripts to FastCGI server listening on

unix:/var/run/www.socket  
location ~ .php$ {  
root /videos;  
fastcgi\_pass unix:/var/run/www.socket;  
fastcgi\_index index.php;  
fastcgi\_param SCRIPT\_FILENAME  
$document\_root$fastcgi\_script\_name;  
include fastcgi\_params;  
}

```
    location ~ /\.ht {
        deny all;
    }

```

}
