Re: mod_mruby to provide an alternative to mod_lua
On 2013/01/21, at 19:03, Daniel Gruno rum...@cord.dk wrote: On 01/21/2013 07:32 AM, 松本 亮介 wrote: Hi Daniel. Thank you for your comment. I have tried to compile and install mod_mruby on my own machine to test it, but there are too many compiler errors for it to work :( In particular, you have a lot of declarations after statements in your code, which is not C90 compliant, and needs fixing. There are also some Did you built mruby? If you don't build murky, you try to build by bellow commands. - mruby and mod_mruby build git clone git://github.com/matsumoto-r/mod_mruby.git cd mod_mruby git submodule init git submodule update cd murby rake cd .. ./configure --with-apxs=/usr/local/apache/bin/apxs --with-apachectl=/usr/local/apache/bin/apachectl make make install - mod_mruby settings cp -p test/test.mrb /usr/local/apache/htdocs/. vi /usr/local/apache/conf/httpd.con (snip) LoadModule mruby_module modules/mod_mruby.so AddHandler mruby-script .mrb (snip) /usr/local/apache/bin/apachectl start - mod_mruby test http://youraddress/test.mrb snip Hi again, I did manage to finally get mod_mruby running on my test server, after a lot of tweaking of your source code. In general, you should always compile your development modules using _maintainer mode_. This can be achieved when you configure the httpd source by running ./configure --enable-maintainer-mode. This should also make apxs run using maintainer mode, which will alert you to anything about the code which doesn't sit right with httpd and the standards we have laid out. Thank you for your idea. I try to implement it. As for how the module runs, I'll include mod_mruby in my talk a bit, showing how mod_lua compares to it as well as mod_php and mod_perl on httpd 2.4 (yes, mod_perl can be built for 2.4 ;) ). While it shows a good performance - considering Ruby is generally a slow language - it does have serious performance issues once you start upping the concurrency on 2.4. At only 30 concurrent clients, I am getting a lot of disconnects and segmentation faults from mod_mruby, making it plummet down to 150 requests per second for a simple hello world script, and at 500 concurrent clients, it's as low as 50 requests per second, possibly because it crashes the server, which then has to re-spawn new workers all the time. I've uploaded a log of GDB at http://apaste.info/dsFz which you can possibly use to figure out why it's behaving like it does. There also seems to be a lot of other exceptions raised when just calling it with 1 client (mrb_exc_raise). Sorry about that. Your apache mpm is worker, but now mod_mruby work properly on prefork mpm. In my future plans, mod_mruby will support thread model like event or worker mpm. I'm studying thread models to support event_mpm. Thank you for GDB log and I refer to it. I have checked mod_mruby which work stable on Apache 2.4.2 preform mpm. I hope you figure these things out, as mod_mruby is a welcome addition to the http server :). If you can get it to run stable on 2.4/2.5 before ApacheCon, I'd love to try it out again and get some proper performance tests going. With regards, Daniel. I'ts awesome! With regards, Ryosuke. MATSUMOTO Ryosuke matsu1229 at gmail.com http://blog.matsumoto-r.jp/
Re: mod_mruby to provide an alternative to mod_lua
Port:80 Document Path: /index.html Document Length:45 bytes Concurrency Level: 100 Time taken for tests: 7.855019 seconds Complete requests: 10 Failed requests:0 Write errors: 0 Total transferred: 3140 bytes HTML transferred: 450 bytes Requests per second:12730.71 [#/sec] (mean) Time per request: 7.855 [ms] (mean) Time per request: 0.079 [ms] (mean, across all concurrent requests) Transfer rate: 3903.75 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect:00 0.7 0 7 Processing: 26 5.2 7 307 Waiting:05 5.2 5 306 Total: 27 5.1 7 308 Percentage of the requests served within a certain time (ms) 50% 7 66% 8 75% 8 80% 8 90% 8 95% 9 98% 9 99% 10 100%308 (longest request) MATSUMOTO Ryosuke matsu1229 at gmail.com http://blog.matsumoto-r.jp/ On 2013/01/21, at 19:29, 松本 亮介 matsu1...@gmail.com wrote: On 2013/01/21, at 19:03, Daniel Gruno rum...@cord.dk wrote: On 01/21/2013 07:32 AM, 松本 亮介 wrote: Hi Daniel. Thank you for your comment. I have tried to compile and install mod_mruby on my own machine to test it, but there are too many compiler errors for it to work :( In particular, you have a lot of declarations after statements in your code, which is not C90 compliant, and needs fixing. There are also some Did you built mruby? If you don't build murky, you try to build by bellow commands. - mruby and mod_mruby build git clone git://github.com/matsumoto-r/mod_mruby.git cd mod_mruby git submodule init git submodule update cd murby rake cd .. ./configure --with-apxs=/usr/local/apache/bin/apxs --with-apachectl=/usr/local/apache/bin/apachectl make make install - mod_mruby settings cp -p test/test.mrb /usr/local/apache/htdocs/. vi /usr/local/apache/conf/httpd.con (snip) LoadModule mruby_module modules/mod_mruby.so AddHandler mruby-script .mrb (snip) /usr/local/apache/bin/apachectl start - mod_mruby test http://youraddress/test.mrb snip Hi again, I did manage to finally get mod_mruby running on my test server, after a lot of tweaking of your source code. In general, you should always compile your development modules using _maintainer mode_. This can be achieved when you configure the httpd source by running ./configure --enable-maintainer-mode. This should also make apxs run using maintainer mode, which will alert you to anything about the code which doesn't sit right with httpd and the standards we have laid out. Thank you for your idea. I try to implement it. As for how the module runs, I'll include mod_mruby in my talk a bit, showing how mod_lua compares to it as well as mod_php and mod_perl on httpd 2.4 (yes, mod_perl can be built for 2.4 ;) ). While it shows a good performance - considering Ruby is generally a slow language - it does have serious performance issues once you start upping the concurrency on 2.4. At only 30 concurrent clients, I am getting a lot of disconnects and segmentation faults from mod_mruby, making it plummet down to 150 requests per second for a simple hello world script, and at 500 concurrent clients, it's as low as 50 requests per second, possibly because it crashes the server, which then has to re-spawn new workers all the time. I've uploaded a log of GDB at http://apaste.info/dsFz which you can possibly use to figure out why it's behaving like it does. There also seems to be a lot of other exceptions raised when just calling it with 1 client (mrb_exc_raise). Sorry about that. Your apache mpm is worker, but now mod_mruby work properly on prefork mpm. In my future plans, mod_mruby will support thread model like event or worker mpm. I'm studying thread models to support event_mpm. Thank you for GDB log and I refer to it. I have checked mod_mruby which work stable on Apache 2.4.2 preform mpm. I hope you figure these things out, as mod_mruby is a welcome addition to the http server :). If you can get it to run stable on 2.4/2.5 before ApacheCon, I'd love to try it out again and get some proper performance tests going. With regards, Daniel. I'ts awesome! With regards, Ryosuke. MATSUMOTO Ryosuke matsu1229 at gmail.com http://blog.matsumoto-r.jp/
Re: mod_mruby to provide an alternative to mod_lua
On 2013/01/21, at 22:03, Daniel Gruno rum...@cord.dk wrote: On 01/21/2013 01:59 PM, 松本 亮介 wrote: Hi Daniel, I tested benchmark of mod_mruby. test case are: snip My main concern here is; is it thread-safe (or even thread-aware)? Most people will be using 2.4 with the event MPM, which is threaded, not the prefork MPM. I have no problems doing concurrency on the prefork MPM, it's with the worker/event MPM that things start to go wrong. mod_mruby is very fast in the prefork MPM, but is not thread-safe. I try to implement thread-safe to mod_mruby. It's challenging!! Thank you for your reply. With regards, Ryosuke.
Re: mod_mruby to provide an alternative to mod_lua
On 2013/01/21, at 22:17, MATSUMOTO Ryosuke matsu1...@gmail.com wrote: On 2013/01/21, at 22:03, Daniel Gruno rum...@cord.dk wrote: On 01/21/2013 01:59 PM, 松本 亮介 wrote: Hi Daniel, I tested benchmark of mod_mruby. test case are: snip My main concern here is; is it thread-safe (or even thread-aware)? Most people will be using 2.4 with the event MPM, which is threaded, not the prefork MPM. I have no problems doing concurrency on the prefork MPM, it's with the worker/event MPM that things start to go wrong. mod_mruby is very fast in the prefork MPM, but is not thread-safe. I try to implement thread-safe to mod_mruby. It's challenging!! Thank you for your reply. With regards, Ryosuke. Hi Daniel, I have implemented thread-safe to mod_mruby. https://github.com/matsumoto-r/mod_mruby So, mod_mruby work fine on worker and event MPM. You can try this before ApacheCon. I try it out again, and get some performance of mod_mruby. 1. benchmark on event MPM $ ab -c 100 -n 10 http://127.0.0.1/hello.mrb This is ApacheBench, Version 2.0.40-dev $Revision: 1.146 $ apache-2.0 Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Copyright 2006 The Apache Software Foundation, http://www.apache.org/ Benchmarking 127.0.0.1 (be patient) Completed 1 requests Completed 2 requests Completed 3 requests Completed 4 requests Completed 5 requests Completed 6 requests Completed 7 requests Completed 8 requests Completed 9 requests Finished 10 requests Server Software:Apache/2.4.3 Server Hostname:127.0.0.1 Server Port:80 Document Path: /hello.mrb Document Length:19 bytes Concurrency Level: 100 Time taken for tests: 7.529994 seconds Complete requests: 10 Failed requests:0 Write errors: 0 Total transferred: 1690 bytes HTML transferred: 190 bytes Requests per second:13280.22 [#/sec] (mean) Time per request: 7.530 [ms] (mean) Time per request: 0.075 [ms] (mean, across all concurrent requests) Transfer rate: 2191.64 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect:00 0.0 0 3 Processing: 16 1.4 7 12 Waiting:16 1.4 7 12 Total: 16 1.4 7 15 Percentage of the requests served within a certain time (ms) 50% 7 66% 7 75% 7 80% 7 90% 9 95% 9 98% 9 99% 10 100% 15 (longest request) 2. benchmark on worker MPM $ ab -c 100 -n 10 http://127.0.0.1/hello.mrb This is ApacheBench, Version 2.0.40-dev $Revision: 1.146 $ apache-2.0 Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Copyright 2006 The Apache Software Foundation, http://www.apache.org/ Benchmarking 127.0.0.1 (be patient) Completed 1 requests Completed 2 requests Completed 3 requests Completed 4 requests Completed 5 requests Completed 6 requests Completed 7 requests Completed 8 requests Completed 9 requests Finished 10 requests Server Software:Apache/2.4.3 Server Hostname:127.0.0.1 Server Port:80 Document Path: /hello.mrb Document Length:19 bytes Concurrency Level: 100 Time taken for tests: 9.578192 seconds Complete requests: 10 Failed requests:0 Write errors: 0 Total transferred: 16902873 bytes HTML transferred: 1900323 bytes Requests per second:10440.38 [#/sec] (mean) Time per request: 9.578 [ms] (mean) Time per request: 0.096 [ms] (mean, across all concurrent requests) Transfer rate: 1723.29 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect:01 0.9 1 4 Processing: 18 0.9 8 29 Waiting:03 1.2 3 29 Total: 19 1.2 9 29 Percentage of the requests served within a certain time (ms) 50% 9 66% 10 75% 10 80% 10 90% 10 95% 11 98% 11 99% 11 100% 29 (longest request)
Re: mod_mruby to provide an alternative to mod_lua
Hi Daniel. Thank you for your comment. I have tried to compile and install mod_mruby on my own machine to test it, but there are too many compiler errors for it to work :( In particular, you have a lot of declarations after statements in your code, which is not C90 compliant, and needs fixing. There are also some Did you built mruby? If you don't build murky, you try to build by bellow commands. - mruby and mod_mruby build git clone git://github.com/matsumoto-r/mod_mruby.git cd mod_mruby git submodule init git submodule update cd murby rake cd .. ./configure --with-apxs=/usr/local/apache/bin/apxs --with-apachectl=/usr/local/apache/bin/apachectl make make install - mod_mruby settings cp -p test/test.mrb /usr/local/apache/htdocs/. vi /usr/local/apache/conf/httpd.con (snip) LoadModule mruby_module modules/mod_mruby.so AddHandler mruby-script .mrb (snip) /usr/local/apache/bin/apachectl start - mod_mruby test http://youraddress/test.mrb errors that force the source code to use 2.2 standards when compiling it for 2.4 or 2.5 - this also needs to be addressed: ap_mrb_connection.c:31 says: #ifdef __APACHE24__ This should probably change to: #if (AP_SERVER_MINORVERSION_NUMBER 2) it's smart! Thanks. Now, configure script figure out apache version from apachectl. I am very interested in how you got to the benchmark results you did. Statistically speaking, Ruby is a very slow language compared to Lua (and in particular LuaJIT which is extremely fast - if you attend my talk at ACNA, I'll show you just how fast ;) ). Which optimizations did you make to the configuration? Which scopes and code caching options did you use for your testing? Did you test mod_lua fom the 2.4 branch or the trunk? I want to attend your talk about mod_lua and lua JIT. I'm getting really excited. I'd also be interested in an English version of your slides, as there may be things to learn from it :) We embrace competition here at Apache, so mod_mruby is a most welcome addition, however I'd really like to get my hands on a working copy, so I can test it out and see what it can really do. One advantage that I could see from the source code is the ability to hook into the logging part of httpd, which is something mod_lua currently lacks. I did not see any filter hooks though - is this something you plan to add, or did I OK. I'll write a paper about mod_mruby in English, and present my work in an international symposium in a few month. Regards, Ryosuke. MATSUMOTO Ryosuke matsu1229 at gmail.com http://blog.matsumoto-r.jp/ On 2013/01/20, at 21:31, Daniel Gruno rum...@cord.dk wrote: On 01/20/2013 10:31 AM, MATSUMOTO Ryosuke wrote: Hi, all I'm Ryosuke MATSUMOTO, a Ph.D. student at Okabe Lab, Network Media Group Department of Intelligence Science and Technology Graduate School of Informatics, Kyoto University in Japan. My English is not very good, but I am studying at the moment to communicate developers of the world. I have been developing mod_mruby and ngx_mruby from Apr 2012. mod_mruby is a web server extension mechanism using embeddable scripting language mruby which has been attracting attention now. mod_mruby abstract: - As the increase of services using Web servers, the number of incidents also is increasing rapidly. In order to solve those problems, it is necessary to extend a functionality of a Web server software. In case of using Apache, developers are required high coding skill of C language and internal specifications of Apache in order to extend the functionality of it. The development of a web server extension requires some high skills, and the maintainability is low since that extension need to compile a code. Therefore, we propose mod_mruby that is a web server extension mechanism using embeddable scripting language mruby which has been attracting attention now. mod_mruby allows to extend the functionality of Apache easily by implementing a mruby script. mod_mruby provides an interface to hook and execute any mruby scripts in the various phases of processing requests inside Apache. When hooking mruby scripts, mruby scripts can process the data of processing requests inside Apache, taking advantage of the characteristics of a embeddable scripting language for C language. We have designed that mod_mruby run at high speed by sharing the data of state transition and the extension library of mruby by multiple mruby scripts and using only different byte code each mruby script. Many developers can implement a web server extension easily by mod_mruby in cooperation with coding style of mruby which is the same as object oriented programming ruby which is widely used by web developers. - see slide share about mod_mruby architecture and performance compared with mod_lua, mod_per, and a module written by C language.(Sorry in Japanese) http://www.slideshare.net/matsumoto_r/mrubyweb snip
Re: [VOTE] accept mod_macro as standard module in httpd
+1 it's awesome! MATSUMOTO Ryosuke matsu1229 at gmail.com http://blog.matsumoto-r.jp/ On 2013/01/05, at 18:30, Igor Galić i.ga...@brainsware.org wrote: +1 - Original Message - I was preparing the IP clearance forms and noticed our original vote thread was more of a discussion. I wanted to record a formal vote here so I can link to it. Pending IP clearance... [+1] accept mod_macro as a standard module and responsibility for its maintenance [ +/- 0] don't care won't help [ -1] don't accept mod_macro as a standard module My +1 -- Eric Covener cove...@gmail.com -- Igor Galić Tel: +43 (0) 664 886 22 883 Mail: i.ga...@brainsware.org URL: http://brainsware.org/ GPG: 6880 4155 74BD FD7C B515 2EA5 4B1D 9E08 A097 C9AE