Skip to content
This repository has been archived by the owner on Dec 3, 2019. It is now read-only.

It doesn't work with app under uwsgi #23

Closed
alexander-akhmetov opened this issue Oct 5, 2016 · 2 comments
Closed

It doesn't work with app under uwsgi #23

alexander-akhmetov opened this issue Oct 5, 2016 · 2 comments

Comments

@alexander-akhmetov
Copy link

alexander-akhmetov commented Oct 5, 2016

Hi!

It is great tool, but I have problems with app under uwsgi. Pyflame shows only (idle) for it. Could you help me please?

Python application (app.py):

# -*- coding: utf-8 -*-
from flask import Flask


app = Flask(__name__)


@app.route('/')
def hello_world():
    return 'Hello, World!'

Starting uwsgi:

[~/pyflame_test]$ uwsgi --workers 1 --module app:app --http-socket=127.0.0.1:8011
*** Starting uWSGI 2.0.12 (64bit) on [Wed Oct  5 04:53:43 2016] ***
...
spawned uWSGI worker 1 (and the only) (pid: 29707, cores: 1)

Starting pyflame:

sudo ./pyflame 29707 -s 5

Making http request:

[~/]$ curl http://127.0.0.1:8011/
Hello, World!

pyflame has printed: (idle) 4363

If I run strace to this worker I'll see:

strace -p 29707
...
read(5, "GET / HTTP/1.1\r\nUser-Agent: curl"..., 4096) = 78
writev(5, [{"HTTP/1.1 200 OK\r\nContent-Type: t"..., 79}, {"Hello, World!", 13}], 2) = 92
...
[~/pyflame_test]$ uwsgi --version
2.0.12
@eklitzke
Copy link
Collaborator

eklitzke commented Oct 5, 2016

Thanks for the bug report. I believe that I found the issue and I've pushed the fix to the uwsgi branch. Can you try building pyflame from that branch and let me know if it fixes the issue for you?

@alexander-akhmetov
Copy link
Author

Yes, it works well now. Thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants