إنضمامك إلي منتديات استراحات زايد يحقق لك معرفة كل ماهو جديد في عالم الانترنت ...

انضم الينا
استراحات زايد الصفحة الرئيسية


إضافة رد
 
LinkBack أدوات الموضوع انواع عرض الموضوع
  #1  
قديم 10-28-2009, 03:10 AM
عضو ماسي
بيانات محروم.كوم
 رقم العضوية : 503
 تاريخ التسجيل : Dec 2007
الجنس : female
علم الدوله :
 المشاركات : 2,100,613
عدد الـنقاط :3341
 تقييم المستوى : 2139

Edit: Don't go around changing Apache settings on production servers if you don't know what you're doing. I hope this info helps someone* but I'm not responsible if the info below causes your server to violently explode.

We recently had an issue where our more heavily-loaded servers would get sluggish at certain peak times of the day* or when getting hammered by various spiders. I made a simple change in our Apache configuration that made a world of difference. In the #phpwebsite channel* a user was complaining of poor performance on a server with 185 branches on it* and this configuration change provided "a noticeable difference right away".

So I figured I'd share it here. If you're running phpWebSite on an Apache server (using the default MPM* prefork.c) and you're having performance issues* try this! It's quick and easy and may solve your problem.

Look for a section in your Apache configuration that looks like this:

Code:

StartServers 8
MinSpareServers 5
MaxSpareServers 20
ServerLimit 256
MaxClients 256
MaxRequestsPerChild 4000

This is the default for Fedora and RHEL* yours may be different on other distros. This section of your configuration is actually very important. Apache's stability and speed is reliant on having multiple server processes running at any given time. One server process can only handle one client request at a time* so it's important to have enough running to service your users* but not so many that you're out of system resources. So basically* you read this section like so:

Start with 8 servers running.
Never have less than 5 servers idling (running but not serving requests).
Never have more than 20 servers idling
Never spawn more than 256 servers
Never allow more than 256 client connections at a time
After a server process has handled up to 4*000 client requests* kill it off and spawn a new one

All of these settings are immensely important (particularly if you're on a resource-starved setup)* but MaxRequestsPerChild is very interesting. You don't want to set this too low* because it takes a lot of CPU time as well as memory to get a process started. It's kind of like starting a car - you don't want to do it every time you stop and go* because that's bad for your engine and your gas mileage.

On the other hand* a server process can build up a lot of gunk over time. PHP has some memory leaks* and Apache probably does too. The process is also maintaining a database connection pool. There's a lot of other things going on. Killing the server process and starting a new one clears up all of these potential messes and starts from a clean slate.

So I set this setting to around 50. I've found that this is high enough (for our traffic levels) that it's not constantly stopping and starting* but low enough that processes do get killed off every now and then. If you're on a higher-traffic or simpler site* you may want to set it higher. If you're on a lower-traffic or more complex site* you may want to set it lower.


tl;dr: in httpd.conf or apache.conf* set MaxRequestsPerChild to around 50 for the prefork.c MPM.
__DEFINE_LIKE_SHARE__
رد مع اقتباس
إضافة رد

مواقع النشر (المفضلة)


تعليمات المشاركة
لا تستطيع إضافة مواضيع جديدة
لا تستطيع الرد على المواضيع
لا تستطيع إرفاق ملفات
لا تستطيع تعديل مشاركاتك

BB code is متاحة
كود [IMG] متاحة
كود HTML معطلة
Trackbacks are متاحة
Pingbacks are متاحة
Refbacks are متاحة


المواضيع المتشابهه
الموضوع كاتب الموضوع المنتدى مشاركات آخر مشاركة
vB or IPB for development of websites محروم.كوم منتدى أخبار المواقع والمنتديات العربية والأجنبية 0 07-19-2010 09:40 AM
Considering using for client websites محروم.كوم منتدى أخبار المواقع والمنتديات العربية والأجنبية 0 02-28-2010 12:40 AM
Several websites licence ? محروم.كوم منتدى أخبار المواقع والمنتديات العربية والأجنبية 0 10-29-2009 05:30 AM
Multiple Websites محروم.كوم منتدى أخبار المواقع والمنتديات العربية والأجنبية 0 10-01-2009 08:40 AM
kids ARE quick ~~~ adults ARE slow ήoOήY نادي محروم للغه الانجليزيه 10 10-20-2008 05:57 PM


الساعة الآن 02:47 PM


Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.5.2 TranZ By Almuhajir

RSS RSS 2.0 XML MAP HTML