Home Too Slow Rails App with SSL
Reply: 1

Too Slow Rails App with SSL

Yalın Semer
1#
Yalın Semer Published in 2017-11-09 21:19:58Z

this is my second rails project. I am not an expert on Rails. i use rails 5 , postgre , ubuntu 14.04 , nginx and passenger for my blog app. ( I have just one blog post ). In my droplet i have 3 apps. 1 laravel and 2 rails apps. But just one of them has SSL.

My website is working on the server ( in production env ). Yesterday I installed SSL and now my site is too slow. I don't know if it is related with SSL or not but it's super slow. Sometimes i wait about 1 min. to load.

In a weird way sometimes site gets faster ( normal speed ) but generally slow. What can be the problem ? How can i solve this issue ?

My SSL nginx config :

server {
   listen 80;
   server_name guclukal.com www.guclukal.com;
   access_log off;
   return 301 https://www.guclukal.com$request_uri;
}

server {

  listen 443 ssl;

  ssl on;
  ssl_certificate /etc/nginx/ssl/guclukal.crt;
  ssl_certificate_key /etc/nginx/ssl/guclukal.key;

  server_name guclukal.com www.guclukal.com;
  passenger_enabled on;
  rails_env production;
  root /home/rails/public;

}

On same droplet i use 2 rails apps. Other project works normal.

I need help !

EDIT : when change my conf file with non-ssl version it works great !

server {
  listen 80;
  server_name guclukal.com www.guclukal.com;
  passenger_enabled on;
  rails_env development;
  root /home/rails/public;
}

EDIT : i use this steps to create ssl :

  1. mkdir /etc/nginx/ssl
  2. openssl req -new -newkey rsa:2048 -nodes -keyout guclukal.key -out guclukal.csr
  3. i paste guclukal.csr to ssls.com to get files
  4. cat guclukal_com.crt guclukal_com.ca-bundle > guclukal.crt to create crt file
  5. than i made my nginx conf file .
Sathishkumar Jayaraj
2#
Sathishkumar Jayaraj Reply to 2017-11-11 07:48:26Z

You have too many css and js files. Try to minify and precompile it into single css and js file. Install ngnix pagespeed module on the server which also improves your site speed. Refer https://developers.google.com/speed/pagespeed/module/ for ngnix page speed installation.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.319945 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO