Saturday, October 3, 2015

How to make HHVM service runs all the time

10:02 PM

How to make HHVM service runs all the time. In this paper the authors will provide solutions for web application developers, in this case the author uses Wrdpress for web applications that run using MariaDB, Nginx and HHVM for alternative php, HHVM known to be very lightweight and can respond quickly reques of web application users.
In this case the author use VPS digitalocean with droplet specification as follows, for the ram and 1 512 processor cores. With debian 7 operating system 64-bit architecture.
I install the application supervisor to manage and maintain service HHVM to remain always running on our server. For more details you can play the following video below:


I include the contents of the config file in the video above:
Content of file : supervisor / hhvm.conf

[program:hhvm]
command=/usr/bin/hhvm -c /etc/hhvm/php.ini -c /etc/hhvm/server.ini -m server
     -vPidFile=/var/run/hhvm/pid
     -vServer.FileSocket=/var/run/hhvm/hhvm.sock
     -vRepo.Central.Path=/var/run/hhvm/hhvm.hhbc
directory=/var/www
numprocs=1
autostart=true            ; start at supervisord start (default: true)
autorestart=unexpected    ; auto restart if HHVM dies
startretries=3
user=www-data  ; setuid to this UNIX account to run the program

[program:nginx]
command=nginx
user = root
autostart=false
#autorestart=unexpected
supervisor / hhvm2.conf
[program:hhvm2]
command=/usr/bin/hhvm -c /etc/hhvm/php.ini -c /etc/hhvm/server.ini -m server
     -vPidFile=/var/run/hhvm/pid2
     -vServer.FileSocket=/var/run/hhvm/hhvm2.sock
     -vRepo.Central.Path=/var/run/hhvm/hhvm.hhbc
directory=/var/www
numprocs=1
autostart=true            ; start at supervisord start (default: true)
autorestart=unexpected    ; auto restart if HHVM dies
startretries=3
user=www-data  ; setuid to this UNIX account to run the program

[program:nginx]
command=nginx
user = root
autostart=false
#autorestart=unexpected
Content of file : /hhvm/server.ini

; php options

pid = /var/run/hhvm/pid

hhvm.server.type = fastcgi
hhvm.server.default_document = index.php
hhvm.log.level = Warning
hhvm.log.always_log_unhandled_exceptions = true
hhvm.log.runtime_error_reporting_level = 8191
hhvm.log.use_log_file = true
hhvm.log.file = /var/log/hhvm/error.log
hhvm.mysql.typed_results = false

hhvm.jit = 1
hhvm.eval.jit_warmup_requests = 1

hhvm.keep_perf_pid_map = 0
hhvm.perf_pid_map = 0
hhvm.perf_data_map = 0

hhvm.server.apc.enable_apc = true
Content of file : /nginx/conf.d/upstream.conf
# Common upstream settings
upstream php {
server unix:/var/run/hhvm/hhvm.sock;
server unix:/var/run/hhvm/hhvm2.sock backup;
}
For questions about hhvm you can leave kometar below. Credit for $10 free for you on digitalocean, you can get this from my link.

Written by

We are one of the initiators of the development of information technology in understanding the need for a solution that is familiar and close to us.

0 comments:

Post a Comment

 

© 2013 Klick Dev. All rights resevered.

Back To Top