Skip to content

Instantly share code, notes, and snippets.

View hnakamur's full-sized avatar

Hiroaki Nakamura hnakamur

View GitHub Profile
@hnakamur
hnakamur / gist:3698719
Created September 11, 2012 14:02
node v0.8.8 test#1
$ ab -n 1000 -c 200 http://192.168.11.103:8080/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 192.168.11.103 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
@hnakamur
hnakamur / gist:3698723
Created September 11, 2012 14:03
node v0.8.8 test#2
$ ab -n 1000 -c 200 http://192.168.11.103:8080/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 192.168.11.103 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
@hnakamur
hnakamur / gist:3698955
Created September 11, 2012 14:19
node v0.8.8 test#3
$ ab -n 1000 -c 200 http://192.168.11.103:8080/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 192.168.11.103 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
@hnakamur
hnakamur / gist:3699222
Created September 11, 2012 14:41
benchmark environment
* Server
* Model: NEC Express5800/S70
* CPU: Intel Pentium G6950 (2.8GHz) (dual core)
* RAM: 16GB DDR3-1333 (PC3-10600)
* Disk: WD1602ABYS-19B7A0 160GB SATA/300 7200rpm Cache 16MB
* OS: Scientific Linux 6.3
* Client
* Model: MacBook Pro Retina, Mid 2012
* CPU: 2.6 GHz Intel Core i7
@hnakamur
hnakamur / gist:3706154
Created September 12, 2012 11:58
parameters to script are not passed to workers.
I added debug prints.
```
static int pmain(lua_State *L) {
uv_loop_t *loop;
/*uv_timer_t gc_timer;*/
struct Smain *s = (struct Smain *)lua_touserdata(L, 1);
char **argv = s->argv;
int script;
int flags = 0;
globalL = L;
@hnakamur
hnakamur / gist:3707508
Created September 12, 2012 15:39
still segfault
(gdb) set follow-fork-mode child
(gdb) run tools/checkit tests/test-fs.lua
Starting program: /Users/hnakamur/mysrc/lev/build/lev tools/checkit tests/test-fs.lua
*lev core started: 47121
✔ fs_sync_test: 10/10 within 2.422 ms
Core exited with status 0, signal 11
Program exited normally.
(gdb) where
No stack.
@hnakamur
hnakamur / gist:3707718
Created September 12, 2012 16:05
SIGSEGV on Linux
(gdb) set follow-fork-mode child
(gdb) run tools/checkit tests/test-fs.lua
Starting program: /home/hnakamur/mysrc/lev/build/lev tools/checkit tests/test-fs.lua
[Thread debugging using libthread_db enabled]
[New process 32304]
[Thread debugging using libthread_db enabled]
process 32304 is executing new program: /home/hnakamur/mysrc/lev/build/lev
[Thread debugging using libthread_db enabled]
*lev core started: 32304
✔ fs_sync_test: 10/10 within 0.239 ms
@hnakamur
hnakamur / gist:3707773
Created September 12, 2012 16:11
build/lev -g tools/checkit tests/test-fs.lua
$ build/lev -g tools/checkit tests/test-fs.lua
GNU gdb (GDB) Red Hat Enterprise Linux (7.2-56.el6)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
@hnakamur
hnakamur / gist:3707846
Created September 12, 2012 16:22
SEGV and stackdump
static int fs_open(lua_State* L) {
int mode;
uv_fs_cb cb;
uv_loop_t *loop = luv_get_loop(L);
uv_fs_t *req = alloc_fs_req(L);
int arg_n = lua_gettop(L);
int arg_i = 1;
const char *path = luaL_checkstring(L, arg_i++);
int flags = fs_checkflags(L, arg_i++);
if (arg_i <= arg_n && lua_isnumber(L, arg_i)) {
@hnakamur
hnakamur / gist:3708084
Created September 12, 2012 16:54
segfault on Linux
$ build/lev tools/checkit tests/test-fs.lua
*lev core started: 3842
✔ fs_sync_test: 10/10 within 0.178 ms
Lua Stack Dump: fs_open before set_callback starting at 5
1: 'LICENSE.txt'
2: 'r'
3: 438
4: <function 0x419d3958>
5: <userdata 0x419d39d8>
Core exited with status 0, signal 11