Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
sasiko Posted July 8, 2013 Posted July 8, 2013 so im on a brand new server which i migrated several cms and ipb forum, have xeon 1230v2, 16gb ecc ram and noticed that my server dies once a week and my httpd memory use around 6-9gb memory each instances. i have low iowait so are there any tool like mysqltuner that can give advice what apache config i can change on httpd.conf? since httpd confg right now is running on default since i got this server 3 weeks ago
Makoto Posted July 8, 2013 Posted July 8, 2013 I would start by suggesting considering a more memory efficient web server such as NGiNX, http://community.invisionpower.com/topic/384522-how-to-set-up-a-secure-ipboard-installation-with-nginx-and-php-fpm/ As for what's causing your specific issues it's hard to say without looking at it myself.
Rhett Posted July 8, 2013 Posted July 8, 2013 How much traffic is this server handling, that amount of memory should be more than enough to handle a a pretty good size site, however as mentioned we would need more info in order to help you, site link perhaps or traffic data etc. However many users in 15 minutes ....
Dmacleo Posted July 8, 2013 Posted July 8, 2013 what COULD cause 6-9gb httpd memory usage? this a php config/cache needed issue?
Makoto Posted July 8, 2013 Posted July 8, 2013 what COULD cause 6-9gb httpd memory usage?this a php config/cache needed issue?Any number of things. A script going AWOL could cause it, there could be memory leaks somewhere, or he could be handling a heavy amount of traffic. Apache with mod_php is not very memory efficient.
sasiko Posted July 8, 2013 Author Posted July 8, 2013 i run a ipb with ddl service so it should pretty much explain the httpd memory usage. for my ipb site it consume around 80gb per day which isnt tat much and average members per 15 minutes are just 100. i see no reason to use nginx when my site isnt a high traffic one. I just think that my server just need optimization dmesg nor httpd error log explains why the server crash.
Makoto Posted July 8, 2013 Posted July 8, 2013 My main forum right now consumes about 1TB of bandwidth a day processing downloads from IPB attachments and IP.Downlaods and not even my web server consumes that much memory.But I've also customized my forum to pass off handling downloads to the web server instead of relying on PHP to process file downloads.http://wiki.nginx.org/XSendfileApache offers Sendfile support as well, and I've meant to look into adding a hook to accomplish this with Apache, but I've never gotten around to it. It may be something worth looking into, but it requires some basic programming knowledge to implement.But 80GB/day doesn't really seem like enough to demand so much memory, even from PHP.
Dmacleo Posted July 9, 2013 Posted July 9, 2013 I didn't think about the download aspect, wouldn't apache mod_xsendfile help no matter if board modded or not due to way it reads headers? may not be as huge a help as actually optimizing the ip downloads for it but thought I had read it still helped. still though, never personally seen that high usage on my end with hundreds of guests (not bots) browsing. even 100 streaming a video from one site on server (not ipb) while the ipb site had 300 on one specific topic didn't have that high memory usage. are you sure its not the CMS you migrated causing the issue?
Makoto Posted July 9, 2013 Posted July 9, 2013 still though, never personally seen that high usage on my end with hundreds of guests (not bots) browsing. even 100 streaming a video from one site on server (not ipb)The problem is IP.Board handles all file downloads through PHP, not through the web server. This is a necessary evil. Sendfile can negate this evil for you by still allowing authentication, logging and so on through PHP without having PHP itself actually handle the file download. (Unless your video streaming service also uses PHP to stream videos, in which case your script scares me.)With enough download traffic it can definitely cause problems, but I still don't think maidos' traffic comes close to justifying those requirements.I didn't think about the download aspect, wouldn't apache mod_xsendfile help no matter if board modded or not due to way it reads headers?I do not know specifically how Apache's mod_xsendfile works. It requires modifications with NGiNX.
Dmacleo Posted July 9, 2013 Posted July 9, 2013 clipbucket for the streaming with apache mod_264 and mod_flvx for pseudostreaming. never specifically looked at sendile,and cannot remember if I compiled with it or not.
Makoto Posted July 9, 2013 Posted July 9, 2013 This is essentially how I have IP.Downloads handle Sendfile with NGiNX. You just replace the entire readfile() function with a few headers. //------------------------------------------ // NGiNX X-Accel headers //------------------------------------------ $throttle = $this->memberData['idm_throttling'] * 1024; @header( "Content-Type: " . $file['mimetype'] ); $this->_sendDispositionHeader( $file['disposition'], $file['name'] ); @header( "X-Accel-Limit-Rate: " . $throttle ); @header( "X-Accel-Redirect: " . $file['sendfile'] );I don't think it's much different with Apache, Apache just uses different headers.Anyways maidos, it's really hard to guess what may be causing your specific issues. If you want to message me and have me look at it personally in my spare time, I wouldn't mind.
sasiko Posted July 12, 2013 Author Posted July 12, 2013 i ended up with fastcgi, although the memory consumption remains the same. How would i change headers for apache though for the script you posted
Makoto Posted July 12, 2013 Posted July 12, 2013 I'll see if I can write up a quick hook to do this. One limitation with Apache's module seems to be that it doesn't support rate limiting (so you can't throttle download speeds through IP.Downloads). (Which I can't do anyways, because rate-limiting is currently unsupported with SPDY connections) For your reference though, https://tn123.org/mod_xsendfile/ This will require configuration changes on your end no matter what. A hook will only make IP.Board compatible with it. You will need to install the module and configure it through your web server manually. On Debian, the package is libapache2-mod-xsendfile I want to reiterate that this could likely do nothing to help your specific issue. If your web server is crashing periodically once a week, any number of things could be wrong, it may not even be a memory issue at all. I would really have to look at your server myself to be of much help.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.