Optimal settings for VPS with 512MB ram (memory issue)

Yes, I've read it, and it's true I've never looked to the free cache. I will try to see if there is some free cache memory when the swap is used.
I've rebooted some hours ago so, right now, there is around 180-200 MB free on the cache and no swap. It happens when there are more people and it's because I have a small traffic, I'm worried having swap atfer some time. :p. Will anyway check more often to see but I notice well when forum is not reactive.
That's said I've reduced varnish allocated memory 256 to 128MB and it will help probably but I still think mysql configuration uses too much memory. If you are good at it, feel free to make suggestions. :D
 
Use MyISAM if you're experiencing RAM issues. Although that WILL cause huge performance degradation compared to InnoDB. :P
 
Sheratan, I've tried APC only, it was so slow. :p Once you put varnish, page loads in a blink eye, it's significant faster. I guess I could remove Memcached but since allocated to 16MB only, I'm not sure it's an issue too, but It's true it sounds like something I could remove.

You could probably offset using Varnish by instead using CloudFlare's CDN, you also get the added benefit of the security.
 
Debian (uses less resource)
nginx - You're not wrong it will use less / fewer resources.
mysql
php - 5.4

Get rid of memcache. That will eat your ram the more people who visit
Get rid of varnish - will also eat resources
Get ride of Libmemcached (you had this with memcache?)

APC, but only have it installed. Don't try to push XenForo to use it.

If you can't get it to run under that setup, you could "try" it without APC. If you're still having issues.... Could it be possible your site has outgrown the current system?
 
Moving to nginx and getting rid of Apache/Varnish would help you the most. I wouldn't suggest memcache on a system with 512M RAM, just go with a small APC configuration, and a file backend for xF.
 
You could probably offset using Varnish by instead using CloudFlare's CDN, you also get the added benefit of the security.
Thanks for the suggestions, but I've already used before CloudFlare and it's absolutely horrible/slow/too much issues, though they have a great interface to manage things.

Debian (uses less resource)
nginx - You're not wrong it will use less / fewer resources.
mysql
php - 5.4

Get rid of memcache. That will eat your ram the more people who visit
Get rid of varnish - will also eat resources
Get ride of Libmemcached (you had this with memcache?)

APC, but only have it installed. Don't try to push XenForo to use it.

If you can't get it to run under that setup, you could "try" it without APC. If you're still having issues.... Could it be possible your site has outgrown the current system?

About php 5.4, I remember having issue related to url/email regex in fields, I could try again, but is there really a benefit to upgrade to 5.4 from 5.3 ?
About varnish, I'm not sure, it offers a great load boost, there is a significant increase in speed. I've reduced memory for it, and will see.
About libmemcached, yes, it's installed to be used with memcached ; I've installed it after reading some post here.
About APC, if I remove "Libmemcached" in the XF config, what should I use, "File" like SneakyDave advises ? since you don't advise to use "APC" ?

I would still need a proper MySQL configuration for an XF forum/Max memory.

Thanks for your answers for now.
 
About APC, if I remove "Libmemcached" in the XF config, what should I use, "File" like SneakyDave advises ? since you don't advise to use "APC" ?

Personally, I'd still use APC, just a small config for it, you may have to restart PHP-FPM (or whatever you're using) once in a while if you have a lot of fragmentation with APC.

But if you choose to not use APC, then you can use a "file" backend cache in xF:

xfroot/library/config.php
Code:
$config['cache']['backend'] = 'File';
$config['cache']['backendOptions'] ['cache_dir'] = '/somewhere/to/put/the/file_cache';

Make sure the cache_dir is writable by the web server.
 
This is what I'm using for my.cnf on my small 512M host. with this configuration, I serve 3 small WP sites, a custom site, and 2 small xf sites.
Code:
max_allowed_packet = 5M
thread_stack = 64K
innodb_buffer_pool_size=110M
innodb_thread_concurrency=3
join_buffer_size=2M
key_buffer_size=128M
max_connections=35
max_heap_table_size=21M
query_cache_limit=1M
query_cache_size=24M
query_cache_type=1
read_buffer_size=2M
skip-networking
sort_buffer_size=3M
net_buffer_length=4K
table_cache=1024
thread_cache_size=286
tmp_table_size=21M
 
Thanks, will make some tests.

Btw, with "File", how things are cached ? I mean it's something fully handled by XF ?
 
yes.

You can take a look at the directory after the file cache is enabled (and xF is in use) to see cache entries in it.
 
Thanks for the suggestions, but I've already used before CloudFlare and it's absolutely horrible/slow/too much issues, though they have a great interface to manage things.



About php 5.4, I remember having issue related to url/email regex in fields, I could try again, but is there really a benefit to upgrade to 5.4 from 5.3 ?
About varnish, I'm not sure, it offers a great load boost, there is a significant increase in speed. I've reduced memory for it, and will see.
About libmemcached, yes, it's installed to be used with memcached ; I've installed it after reading some post here.
About APC, if I remove "Libmemcached" in the XF config, what should I use, "File" like SneakyDave advises ? since you don't advise to use "APC" ?

I would still need a proper MySQL configuration for an XF forum/Max memory.

Thanks for your answers for now.


APC will improve php performance all on its own. You don't need to add it to the config file (in XenForo). Just having it will be good enough. Adding it to your config file could add to your resources (depending on what you have installed with XenForo).

php 5.4 will get you a small speed boost compared to 5.3. The current XenForo build supports it (1.1.4) and I believe most of the add-ons out today do as well. But if you do have problems with it, you could always downgrade back to 5.3 (on Debian its easy to do)

memcached / memcache (no matter which one you're using) .... You don't really need it and honestly its only going to add to that load.

I would use SneakyDave's config for MySQL
http://xenforo.com/community/thread...2mb-ram-memory-issue.47686/page-2#post-517830
 
I've tried to update to php 5.4 and somehow resulting breaking things. :ROFLMAO:
Luckily I had a backup of the system disk.
After cleaning things a bit, and trying again, it has working fine. And it's true, without memcache and with php5.4, site is slighty faster, at least you can feel it's more reactive. :)

But It would seem I've some trouble with APC. I want to use the package from dotdeb and installed php5-apc, but I think I've installed it before from source to compile with igbinary support.
Looking at phpinfo(), it still says v3.1.13, when it should be v.3.1.14.

Do you know how to uninstall previous APC version compiled from source ?
 
I haven't tried compiling APC from source in quite a while, but maybe you just need to make sure that your /etc/php.ini file, or your apc.ini file in /etc/php.d/ is pointing to the correct APC extension (apc.so). Just a guess. I don't use dotdeb, so those directories are probably not quite correct.
 
Well, extension=apc.so ; but not sure where it's located.

When I try to find it, I get :

root@cs-amx:/# find . -type f -name apc.so
./usr/lib/php5/20100525+lfs/apc.so
./usr/lib/php5/20090626+lfs/apc.so
./usr/share/apc/modules/apc.so
./usr/share/apc/.libs/apc.so
Not sure what is 20100525+/20090626+ and not sure what apc.so it's using.
 
memcached / memcache (no matter which one you're using) .... You don't really need it and honestly its only going to add to that load.
Totally agree. I spent ages tweaking and configuring memcached / memcache, and then moving the libmemcached. Yes it works, but on a single server, it's totally pointless. I now use Xcache and have it cache the php files and the back end, and it seems better than memcache at doing it on a single server set up.
 
MattW, do you have some thoughts on APC vs Xcache ? From what I've read eAccelerator wins all the time, while Xcache is generally faster than APC.
 
I've tried to update to php 5.4 and somehow resulting breaking things. :ROFLMAO:
Luckily I had a backup of the system disk.
After cleaning things a bit, and trying again, it has working fine. And it's true, without memcache and with php5.4, site is slighty faster, at least you can feel it's more reactive. :)

But It would seem I've some trouble with APC. I want to use the package from dotdeb and installed php5-apc, but I think I've installed it before from source to compile with igbinary support.
Looking at phpinfo(), it still says v3.1.13, when it should be v.3.1.14.

Do you know how to uninstall previous APC version compiled from source ?
3.1.13 is the current version
http://pecl.php.net/package/APC
3.1.14 was removed because of a memory leak.

You're not missing anything and everything is as it should be.

If you had 3.1.14 before... That maybe the cause of your issues from earlier.... Look at the bright side... You've learned how to configure it even more from this thread. :)
 
For my own set up, and another I've done for a member on here, we have both moved away from APC in favour of Xcache 3.0.1 (and removed memcache)

We are both using CentOS with Apache though.

I found Xcache handles the backend caching better than APC, as APC fragments after a while, where Xcache has been stable for weeks without needing a restart.

This is from my xcache-admin page. cache has been running since the 9th
xcache-admin.webp
 
No, I was using 3.1.13 installed from source with igbinary support.
And when I've upgrading php, I've added php5-apc, which is supposed to be APC 1.1.14 (http://www.dotdeb.org/2013/01/24/php-5-4-11/)
I thought somehow it was still using old version.

So, you're saying by using php5-apc, it will used this one (not the old version) and for some reason, the last version is still 3.1.13, right ?
 
xCache is seems to be good for XenForo. But he will still use up more resources. 512MB is something I keep looking at.

Although I do agree that it would be better to use for caching XenForo.

Still keep APC installed.... Just don't add it to the config.php file.
 
Top Bottom