VPS nginx + plesk พอคนเข้าเว็บเยอะ แล้วมันช้ามาก จนไม่ตอบสนองครับ

เริ่มโดย เบียร์ซาโม่, 30 ตุลาคม 2013, 13:41:05

หัวข้อก่อนหน้า - หัวข้อถัดไป

0 สมาชิก และ 1 ผู้มาเยือน กำลังดูหัวข้อนี้

speeduphosting

อ้างถึงจาก: icez ใน 30 ตุลาคม 2013, 23:46:48
จริงๆ นะ ผมว่าเค้าลืมจูน nginx ...

เจอบ่อยกรณีใช้ plesk

ท่านไอซ์มาตอบเองไม่มีพลาดครับ
[direct=http://www.speeduphosting.com][/direct]

เบียร์ซาโม่

หลักจากที่ทางซัพซอร์ทเค้า config ให้ ตอนนี้ 1500+ useronline ยังไม่มีอาการอืดแบบเดิมเลยครับ ลื่นมากครับ
(จากตอนแรก 300-500 online อืด จนไม่ตอบสนอง)
แต่รอดูช่วง peak time ของเว็บผม ว่าเจอ useronline ระดับหมื่นขึ้น จะเป็นยังไง แต่คิดว่าคงหายแล้วครับ

ขอบคุณทุกท่านครับ

icez

ได้ไม่ได้ยังไง cat /etc/nginx/nginx.conf มาให้ดูหน่อยก็ดีครับ
[direct=http://www.thzhost.com/]THZHost[/direct] SSD Hosting ไทย/สิงคโปร์ พร้อม firewall ป้องกันการยิงเว็บ + scan ไวรัสในเว็บ

เบียร์ซาโม่

#23
อ้างถึงจาก: icez ใน 31 ตุลาคม 2013, 14:24:49
ได้ไม่ได้ยังไง cat /etc/nginx/nginx.conf มาให้ดูหน่อยก็ดีครับ

ซัฟพอร์ต เค้าแก้ให้ 2 ไฟล์นี้ครับ /etc/nginx/nginx.conf เขาไม่ได้แก้ไขครับ
อ้างถึงI understand that you need to know more about the optimized configuration of your server. You can review this by checking the configuration file /etc/httpd/conf/httpd.conf and /etc/my.cnf .



นี้เป็น /etc/nginx/nginx.conf ครับ น่าจะเป็นค่าเดิม

#user  nginx;
worker_processes  1;

#error_log  /var/log/nginx/error.log;
#error_log  /var/log/nginx/error.log  notice;
#error_log  /var/log/nginx/error.log  info;

#pid        /var/run/nginx.pid;


events {
   worker_connections  1024;
}


http {
   include       mime.types;
   default_type  application/octet-stream;

   #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
   #                  '$status $body_bytes_sent "$http_referer" '
   #                  '"$http_user_agent" "$http_x_forwarded_for"';

   #access_log  /var/log/nginx/access.log  main;

   sendfile        on;
   #tcp_nopush     on;

   #keepalive_timeout  0;
   keepalive_timeout  65;
   #tcp_nodelay        on;

   #gzip  on;
   #gzip_disable "MSIE [1-6]\.(?!.*SV1)";

   server_tokens off;

   include /etc/nginx/conf.d/*.conf;
}




ถ้ามีคำแนะนำดีๆ ช่วยบอกทีนะครับ ขอบคุณครับ

icez

worker_processes  4;
worker_rlimit_nofile 16384; << เพิ่มบรรทัดนี้


events {
    worker_connections  8192;
}


[direct=http://www.thzhost.com/]THZHost[/direct] SSD Hosting ไทย/สิงคโปร์ พร้อม firewall ป้องกันการยิงเว็บ + scan ไวรัสในเว็บ

เบียร์ซาโม่

ตั้งค่าตามที่คุณ icez เพิ่มแล้วครับ

คือผมมีคำถามนิดหน่อยครับ คืออยากรู้เรื่องพวกนี้บ้างสักนิดก็ยังดี
worker_processes (คืออะไรครับ ใช่จำนวน คอร์ ของ cpu ไหมครับ)
worker_rlimit_nofile (นี้คือค่าอะไรครับ)
worker_connections (นี้คือค่าอะไรครับ เห็นกำหนดเท่าจำนวนแรม)


ขอบคุณ คุณ icez มากครับ

iczykung

Affiliate Hosting สูงสุด 10% (ได้ทุกรอบบิล..รวมถึงต่ออายุ) สนใจ PM  [direct=https://coopnix.co.th]Cloud Enterprise Hosting (cPanel/DirectAdmin) [/direct][direct=https://coopnix.co.th]Enterprise SAS VPS[/direct]
[direct=https://coopnix.co.th]   Cloud Enterprise SSD VPS by VMWare  [/direct]
✔ CPU up to 40 Core ✔ Ram up to 128GB ✔ Disk up to 512GB ✔ Unmetered Bandwidth 
✔ High Availability nodes ✔ Cloud SSD Enterprise Storage ✔ 20Gbps Cluster Network ✔ Free DDoS Protection

icez

worker_rlimit_nofile => resource limit : number of open file  (จำนวน file descriptor ที่ใช้งานได้พร้อมกัน) ปกติมัน 1024 ซึ่งทำให้รับ connection ได้ราวๆ 300-400 connection

worker_connections ตรงตัวฮะ
[direct=http://www.thzhost.com/]THZHost[/direct] SSD Hosting ไทย/สิงคโปร์ พร้อม firewall ป้องกันการยิงเว็บ + scan ไวรัสในเว็บ

เบียร์ซาโม่

ขอบคุณทั้งสองท่านครับ

ว่าแต่ worker_processes นี้เป็น core cpu
ของผมมันมี 8 คอร์ จะต้องกำหนด worker_processes 8 ด้วยรึป่าวครับ

iczykung

อ้างถึงจาก: เบียร์ซาโม่ ใน 31 ตุลาคม 2013, 15:42:15
ขอบคุณทั้งสองท่านครับ

ว่าแต่ worker_processes นี้เป็น core cpu
ของผมมันมี 8 คอร์ จะต้องกำหนด worker_processes 8 ด้วยรึป่าวครับ

เข้าใจถูกต้องแล้วครับ
Affiliate Hosting สูงสุด 10% (ได้ทุกรอบบิล..รวมถึงต่ออายุ) สนใจ PM  [direct=https://coopnix.co.th]Cloud Enterprise Hosting (cPanel/DirectAdmin) [/direct][direct=https://coopnix.co.th]Enterprise SAS VPS[/direct]
[direct=https://coopnix.co.th]   Cloud Enterprise SSD VPS by VMWare  [/direct]
✔ CPU up to 40 Core ✔ Ram up to 128GB ✔ Disk up to 512GB ✔ Unmetered Bandwidth 
✔ High Availability nodes ✔ Cloud SSD Enterprise Storage ✔ 20Gbps Cluster Network ✔ Free DDoS Protection

iLhay

อ้างถึงจาก: เบียร์ซาโม่ ใน 31 ตุลาคม 2013, 15:42:15
ขอบคุณทั้งสองท่านครับ

ว่าแต่ worker_processes นี้เป็น core cpu
ของผมมันมี 8 คอร์ จะต้องกำหนด worker_processes 8 ด้วยรึป่าวครับ

ใส่ไปแค่ 4 ก็พอครับ

worker_processes * worker_connection = ปริมาณ connection ที่รับได้ในช่วงระยะเวลาหนึ่ง ถึงแล้วค่อยขยับ
[direct=https://bangmod.cloud/wordpress-hosting/]Wordpress Hosting

[/direct]
[direct=https://bangmod.cloud/wordpress-hosting/]Wordpress Hosting[/direct] เริ่มต้นปีละ 790 บาท NVMe SSD เร็ว 9000MB/s เร็วกว่านี้ไม่มีอีกแล้ว
[direct=https://bangmod.cloud/cloud-server]Cloud Server[/direct] เริ่มต้นเพียงเดือนละ 159 บาท พร้อมใช้ภายใน 1 นาที ผ่านระบบอัตโนมัติมีทั้ง Linux / Windows / DirectAdmin
สอบถามข้อมูลและแจ้งปัญหา 02-105-4417 ตลอด 24 ชั่วโมง

เบียร์ซาโม่


ohmohm