WebFaction
Community site: login faq

This is sort of a fragmented question. Sorry for the lack of specific direction but it's all tied together in the issue of me deciding whether to use any of the Webfaction shared resources.

I'm currently running a PHP app using the default settings with the shared Apache server. I don't have access to Imagemagick or APC using this setup so I was thinking of rolling my own server for more control. This opens up the door for some other decisions to be made.

There seems to be definite performance improvements using PHP-FPM + Nginx instead of Apache according to pretty much every result on Google on the subject. Would this completely remove my ability to use .htaccess? Are there any other downsides I should be aware of?

According to a reply by a Webfaction employee in this thread there are performance benefits to be gained from rolling your own MySQL server as it would have access to more RAM and CPU cycles running under a user account than the shared MySQL user account. This is something I've never done before on a non-Debian system.

I would like to run APC for performance benefits. I use XenForo and it has some built-in caching functionality. How far would APC push my RAM usage up? How easy is that to configure to make sure it doesn't start getting processes killed? If I am correct, memcached is best for scaling and load balancing while APC is better for basic caching on a low traffic site? Does anyone have any insight on this in the context of hosting here on Webfaction with the standard 256MB of RAM?

I've done my own Nginx + uWSGI server and that was a walk in the park. Doing PHP from source looks like a lot more work. Also future upgrades look like they could be an issue. ANY thoughts on this subject would be helpful. Thanks.

asked 18 Jun '13, 12:34

HittingSmoke
4822230
accept rate: 8%


Using PHP-FPM + Nginx instead of Apache would indeed remove your ability to use .htaccess files, but you would instead be able to modify your Nginx configuration to accomplish the same things that you're doing in .htaccess right now.

Running a private MySQL instance isn't as difficult as it used to be - we have a one-click install for it in our control panel, so you don't need to build it from source.

Anything you do that caches stuff in RAM is going to push your RAM usage up. Finding the best configuration requires testing.

Regarding memcached vs APC, that's an apples vs oranges comparison:

  • memcached is not a load balancer - it's a cache, most commonly used to cache results of expensive database queries and computationally-expensive information. If that's what you need to do, then memcached would be a good choice.
  • APC is an opcode cache - it caches compiled PHP code so that it doesn't need to be parsed and compiled on every request. If that's what you need to do, then APC would be a good choice.
  • If you need to do both of those things, then use them both.

Building PHP from source and maintaining it isn't that difficult. Just keep track of what you do, and what you install (extensions and whatnot) afterwards, so that you'll know what to do when you need to upgrade.

permanent link

answered 19 Jun '13, 12:16

seanf
12.2k41836
accept rate: 37%

edited 24 Oct '13, 12:57

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×262
×186
×168
×9
×6

question asked: 18 Jun '13, 12:34

question was seen: 25,302 times

last updated: 24 Oct '13, 12:57

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM