Is it normal when HHVM uses too much memory?


#1

Hi, I currently have a vps instance with 6Gb’s of ram, I read about the performance gains of hhvm and decided to try it on one of my production sites, after turning on hhvm, I noticed some performance improvements but my memory usage has gone up to 1.5GB of ram as opposed to 300-500MB of ram I used to get before HHVM.

I looked around for performance tuning configurations and saw an article on github where facebook recommended turning on the RepoAuthoritative mode since it helps to pre-compile the source code into a bytecode repo. Ever since I enabled it my memory usage has gone up to 2.9GB’s of ram.

I’m not sure if this is how HHVM is supposed to behave with memory or I just have something wrong in my hhvm config. Also I’ve noticed service php5-fpm status always has the stop/waiting response even when I can see it running with top , is that as a result of hhvm running simultaneously with php5-fpm as a fallback?


#2

would love to get news on this. I’ve been getting a similar issue, but I only have 1g of ram on digitialocean without hhvm, i get around 300-400 ram usage with php+w3tc+nginx etc but now its hitting 900

any ideas guys?


#3

Of course it is normal. I don’t get what’s the point of “minimizing” RAM usage. If you have available RAM you pay for it. So, use it! :slight_smile:


#4

yea but its using nearly all the ram i have? constantly…


#5

@Liveware thought this might help…

As a general example, if your Droplet has 2GB of RAM it should be safe to dedicate around 1.2 GB to HHVM. To make this happen, edit the file /etc/hhvm/php.ini with your favorite editor (sudo vim /etc/hhvm/php.ini) and add a new variable after the ; php options section:

/etc/hhvm/php.ini memory_limit = 1200M


#6

Please, explain what’s the matter on using all available RAM.


#7

i dont know if there is a problem. but i have html sites that dont use php that are also affected by performance. if there ram is used upto 98% because of hhvm, then this will affect server performance for emails too, no? or do i have it wrong.


#8

If CPU usage is high, or server load as a whole is high, you have a situation.

If RAM usage is high, but server is not sluggish, server load is healthy, there is no reason to worry.


#9

I had issues where HHVM would continuously use up all RAM and then my databases would crash. For a while I used Monit to restart HHVM once it got to 1.6GB on a 2GB box, but that was happening often. Now that PHP-7.0 is included, I prefer running that over HHVM.

HHVM and PHP 7 are very close on performance, but from everything I’ve seen, HHVM is slightly faster with WordPress. Other applications run faster on PHP 7. I personally decided to switch back to PHP once version 7 came out. I have since decreased my web server size to 512MB and switched to a remote database (1GB). I’m running about 7 sites on it with great performance.


#10

have you tried to limit the hhvm ram usage like the post above says?


#11