少し前になるが、nginx の 1.0.0 がリリースされた。
Here we go!
nginx-1.0.0 stable version has been released.
The repository is available at svn://svn.nginx.org.
nginx development was started about 9 years ago. The first public version 0.1.0 has been released on October 4, 2004. Now W3Techs reports that 6.8% of the top 1 million sites on the web (according to Alexa) use nginx. And 46.9% of top Russian sites use nginx.
Netcraft reports similar 6.52% nginx share of the million busiest sites in April 2011.
既に 10 日ほど経ってしまったが、アップデートしようと思う。
$ /usr/local/nginx/sbin/nginx -V nginx version: nginx/0.8.54 built by gcc 4.4.3 (Ubuntu 4.4.3-4ubuntu5) TLS SNI support enabled configure arguments: --without-http_fastcgi_module --without-http_uwsgi_module --without-http_scgi_module --without-http_memcached_module --without-http_geo_module --with-http_ssl_module $
便利だ。ダウンロードして展開してコンフィグ、make、インストール 。
$ curl -O http://nginx.org/download/nginx-1.0.0.tar.gz $ tar zxvf nginx-1.0.0.tar.gz $ cd nginx-1.0.0/ $ ./configure --without-http_fastcgi_module --without-http_uwsgi_module --without-http_scgi_module --without-http_memcached_module --without-http_geo_module --with-http_ssl_module $ make $ sudo make install
$ ps ax PID TTY STAT TIME COMMAND 741 ? Ss 0:00 nginx: master process /usr/local/nginx/sbin/nginx 743 ? S 1:12 nginx: worker process 744 ? S 1:15 nginx: worker process 745 ? S 1:10 nginx: worker process 746 ? S 1:14 nginx: worker process
次に稼働中のマスタープロセスに USR2 シグナルを送る。送ると、新しいプロセス群が動き出すが、古いプロセスも動いている。
$ sudo kill -USR2 741 $ ps ax PID TTY STAT TIME COMMAND 741 ? Ss 0:00 nginx: master process /usr/local/nginx/sbin/nginx 743 ? S 1:12 nginx: worker process 744 ? S 1:15 nginx: worker process 745 ? S 1:10 nginx: worker process 746 ? S 1:14 nginx: worker process 16706 ? S 0:00 nginx: master process /usr/local/nginx/sbin/nginx 16707 ? S 0:00 nginx: worker process 16708 ? S 0:00 nginx: worker process 16709 ? S 0:00 nginx: worker process 16710 ? S 0:00 nginx: worker process $
次に古いワーカープロセス群を止めるために WINCH シグナルを送る。
$ sudo kill -WINCH 741 $ ps ax PID TTY STAT TIME COMMAND 741 ? Ss 0:00 nginx: master process /usr/local/nginx/sbin/nginx 16706 ? S 0:00 nginx: master process /usr/local/nginx/sbin/nginx 16707 ? S 0:00 nginx: worker process 16708 ? S 0:00 nginx: worker process 16709 ? S 0:00 nginx: worker process 16710 ? S 0:00 nginx: worker process $
古いワーカープロセス群が止まったのを確認して古いマスタープロセスを止める。
$ sudo kill -QUIT 741 $ ps ax PID TTY STAT TIME COMMAND 16706 ? S 0:00 nginx: master process /usr/local/nginx/sbin/nginx 16707 ? S 0:00 nginx: worker process 16708 ? S 0:00 nginx: worker process 16709 ? S 0:00 nginx: worker process 16710 ? S 0:00 nginx: worker process $
で、終わり。この記事を書いている Blog システムが nginx を経由して動いているのだが、何も問題なし。よく考えたら危ないなぁ。