fastos / fastsocket

Fastsocket is a highly scalable socket and its underlying networking implementation of Linux kernel. With the straight linear scalability, Fastsocket can provide extremely good performance in multicore machines. In addition, it is very easy to use and maintain. As a result, it has been deployed in the production environment of SINA.
GNU General Public License v2.0
3.76k stars 730 forks source link

Will fastsocket work with other kernel? #49

Closed igroykt closed 7 years ago

igroykt commented 8 years ago

Will fastsocket work if i'm using 2.6.32-504 kernel? Or it will work only with patched kernel (with included kernel)?

gfreewind commented 8 years ago

Yes. The fastsocket is based on 2.6.32

igroykt commented 8 years ago

thank for answer but it didnt work with 2.6.32-504 kernel (LD_LOAD=/lib64/libfsocket.so nginx and nothing happens). with included kernel it seems like work fine but how can i check if nginx started with libfsocket?

ps -ef|grep nginx root 3098 1 0 14:17 ? 00:00:00 nginx: master process nginx nginx 3099 3098 0 14:17 ? 00:00:00 nginx: worker process nginx 3100 3098 0 14:17 ? 00:00:00 nginx: worker process nginx 3101 3098 0 14:17 ? 00:00:00 nginx: cache manager process root 7001 4155 0 14:43 pts/0 00:00:00 grep nginx pmap 3098|grep .so 00007f0ed2edb000 48K r-x-- /lib64/libnss_files-2.12.so 00007f0ed2ee7000 2048K ----- /lib64/libnss_files-2.12.so 00007f0ed30e7000 4K r---- /lib64/libnss_files-2.12.so 00007f0ed30e8000 4K rw--- /lib64/libnss_files-2.12.so 00007f0ed30e9000 8K r-x-- /lib64/libfreebl3.so 00007f0ed30eb000 2044K ----- /lib64/libfreebl3.so 00007f0ed32ea000 4K r---- /lib64/libfreebl3.so 00007f0ed32eb000 4K rw--- /lib64/libfreebl3.so 00007f0ed32ec000 1576K r-x-- /lib64/libc-2.12.so 00007f0ed3476000 2048K ----- /lib64/libc-2.12.so 00007f0ed3676000 16K r---- /lib64/libc-2.12.so 00007f0ed367a000 4K rw--- /lib64/libc-2.12.so 00007f0ed3680000 84K r-x-- /lib64/libz.so.1.2.3 00007f0ed3695000 2044K ----- /lib64/libz.so.1.2.3 00007f0ed3894000 4K r---- /lib64/libz.so.1.2.3 00007f0ed3895000 4K rw--- /lib64/libz.so.1.2.3 00007f0ed3896000 8K r-x-- /lib64/libdl-2.12.so 00007f0ed3898000 2048K ----- /lib64/libdl-2.12.so 00007f0ed3a98000 4K r---- /lib64/libdl-2.12.so 00007f0ed3a99000 4K rw--- /lib64/libdl-2.12.so 00007f0ed3a9a000 176K r-x-- /lib64/libpcre.so.0.0.1 00007f0ed3ac6000 2048K ----- /lib64/libpcre.so.0.0.1 00007f0ed3cc6000 4K rw--- /lib64/libpcre.so.0.0.1 00007f0ed3cc7000 28K r-x-- /lib64/libcrypt-2.12.so 00007f0ed3cce000 2048K ----- /lib64/libcrypt-2.12.so 00007f0ed3ece000 4K r---- /lib64/libcrypt-2.12.so 00007f0ed3ecf000 4K rw--- /lib64/libcrypt-2.12.so 00007f0ed3efe000 92K r-x-- /lib64/libpthread-2.12.so 00007f0ed3f15000 2048K ----- /lib64/libpthread-2.12.so 00007f0ed4115000 4K r---- /lib64/libpthread-2.12.so 00007f0ed4116000 4K rw--- /lib64/libpthread-2.12.so 00007f0ed411b000 128K r-x-- /lib64/ld-2.12.so 00007f0ed433a000 4K r---- /lib64/ld-2.12.so 00007f0ed433b000 4K rw--- /lib64/ld-2.12.so

gfreewind commented 8 years ago

You typo wrong word. It is "LD_PRELOAD", not "LD_LOAD"

igroykt commented 8 years ago

@gfreewind oh my mistake. now nginx wont start with LD_PRELOAD.

LD_PRELOAD=/lib64/libfsocket.so nginx ps -ef|grep nginx root 12250 12221 0 22:12 pts/0 00:00:00 grep nginx uname -a 2.6.32-431.29.2.el6.FASTSOCKET #2 SMP Sun Nov 8 01:27:25 YAKT 2015 x86_64 x86_64 x86_64 GNU/Linux

and there is no error messages in error.log or syslog.

ups! it work now. thank for help.

00007f46de6c9000 8K r-x-- /lib64/libfsocket.so 00007f46de6cb000 2044K ----- /lib64/libfsocket.so 00007f46de8ca000 4K rw--- /lib64/libfsocket.so

gfreewind commented 8 years ago

NP. Be free to raise the question.

igroykt commented 8 years ago

@gfreewind apache not working with fsocket? i see in child processes here is how i modified init script:

httpd=${HTTPD-LD_PRELOAD=/lib64/libfsocket.so /usr/sbin/httpd}

and here is how it starts:

start() { echo -n $"Starting $prog: " LANG=$HTTPD_LANG daemon --pidfile=${pidfile} $httpd $OPTIONS RETVAL=$? echo [ $RETVAL = 0 ] && touch ${lockfile} return $RETVAL }

and after restart of httpd i saw 502 error until nginx restart. some kind of cache?

gfreewind commented 8 years ago

It could support apache. Which cache?

igroykt commented 8 years ago

@gfreewind hmmm...will take a look at strace output later. nginx gives error 502 until i restarted him (tried to restart apache 3 times before restarting nginx). may be it related with that:

Mysql2::Error: MySQL server has gone away: SHOW FULL FIELDS FROM settings Completed 500 Internal Server Error in 17ms (ActiveRecord: 0.4ms) ActiveRecord::StatementInvalid (Mysql2::Error: MySQL server has gone away: SHOW FULL FIELDS FROM settings): app/models/setting.rb:186:in check_cache' app/controllers/application_controller.rb:102:inuser_setup'

seems like temporary problem at startup. mysql show this error within 2-3 minutes after start.

igroykt commented 8 years ago

i can't debug httpd. parent process doesn't show any errors and childs die too often.

gfreewind commented 8 years ago

Why you couldn't debug it ? you could try the gdb and let it trace the child process

igroykt commented 8 years ago

@gfreewind because gdb says that i need some debug packages for some php modules but i can't find them in repositories. Will try later on naked httpd under VM.