This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rpython_startup_code(); | |
pypy_setup_home("/root/pypy/pypy",0); | |
pypy_execute_source( | |
"import cffi\n" | |
"ffi = cffi.FFI()\n" | |
"ffi.cdef('void (*callback)(long);')\n" | |
"lib = ffi.verify('void (*callback)(long);')\n" | |
"def callback(i):\n" | |
" print('x')\n" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Data::Dumper; | |
RETRY=-1; | |
OK=-2; | |
IGNORE=0; | |
uwsgi::spooler(sub { | |
my $env = shift; | |
print Dumper($env); | |
return OK; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Net::uwsgi; | |
use IO::Socket::INET; | |
my $pkt = uwsgi_pkt(0, 0, {'PATH_INFO' => 'foobar', 'test' => 'test001'}); | |
my $socket = IO::Socket::INET->new(PeerAddr => '192.168.173.55:4040'); | |
$socket->send($pkt); | |
$socket->send($pkt); | |
$socket->send($pkt); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; run it as uwsgi --ini emperor.ini:emperor | |
[emperor] | |
emperor = vassals17 | |
vassals-include = %p | |
[uwsgi] | |
logto = /tmp/%(app).log |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;app1 | |
[uwsgi] | |
socket = zzz | |
wsgi-file = www | |
myip = 192.168.0.1 | |
; myself | |
legion = group001 %(myip):5050 99 bf-cbc:secret01 | |
; scroll | |
legion-scroll = group001 www.unbit.it | |
; other members |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -r 13938246ac64 -r 615a0acdb06b pypy/goal/targetpypystandalone.py | |
--- a/pypy/goal/targetpypystandalone.py Fri May 24 13:36:53 2013 +0200 | |
+++ b/pypy/goal/targetpypystandalone.py Fri May 24 15:07:20 2013 +0200 | |
@@ -124,14 +124,21 @@ | |
@entrypoint('main', [], c_name='pypy_init_threads') | |
def pypy_init_threads(): | |
- if space.config.objspace.usemodules.thread: | |
- os_thread.setup_threads(space) | |
- rffi.aroundstate.before() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Report memory usage after each request (app loaded before fork): | |
uwsgi --http-socket :9090 --pypy-home /opt/pypy --memory-report --master --processes 4 --pypy-wsgi werkzeug.testapp:test_app | |
Report memory usage after each request (app loaded after fork): | |
uwsgi --http-socket :9090 --pypy-home /opt/pypy --lazy-apps --memory-report --master --processes 4 --pypy-wsgi werkzeug.testapp:test_app | |
Enable KSM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -r 5e25ae4de748 pypy/goal/targetpypystandalone.py | |
--- a/pypy/goal/targetpypystandalone.py Sat May 18 13:31:35 2013 +0200 | |
+++ b/pypy/goal/targetpypystandalone.py Sat May 18 19:46:43 2013 +0200 | |
@@ -129,7 +129,12 @@ | |
@entrypoint('main', [], c_name='pypy_thread_attach') | |
def pypy_thread_attach(): | |
+ os_thread.setup_threads(space) | |
+ os_thread.bootstrapper.acquire(space, None, None) | |
rthread.gc_thread_start() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -r 32dd588a5e23 pypy/goal/targetpypystandalone.py | |
--- a/pypy/goal/targetpypystandalone.py Fri May 17 16:41:25 2013 -0700 | |
+++ b/pypy/goal/targetpypystandalone.py Sat May 18 13:03:29 2013 +0200 | |
@@ -10,6 +10,8 @@ | |
from rpython.config.config import ConflictConfigError | |
from pypy.tool.option import make_objspace | |
from pypy.conftest import pypydir | |
+from rpython.rlib import rthread | |
+from pypy.module.thread import os_thread | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[uwsgi] | |
; create the socket 0 (uwsgi protocol) | |
socket = 127.0.0.1:3031 | |
; create the socket 1 (HTTP protocol) | |
http-socket = 127.0.0.1:8080 | |
; spawn the master | |
master = true | |
; spawn 4 processes | |
processes = 4 |