Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Never loads? #302

Closed
adrianocr opened this issue Jul 3, 2015 · 8 comments
Closed

Never loads? #302

adrianocr opened this issue Jul 3, 2015 · 8 comments

Comments

@adrianocr
Copy link

Installed on OSX and I'm getting the following issue:

Adrianos-MacBook-Pro:locust adriano$ locust --host=http://domain.com
/usr/local/lib/python2.7/site-packages/locust/rpc/__init__.py:6: UserWarning: WARNING: Using pure Python socket RPC implementation instead of zmq. If running in distributed mode, this could cause a performance decrease. We recommend you to install the pyzmq python package when running in distributed mode.

warnings.warn("WARNING: Using pure Python socket RPC implementation instead of zmq. If running in distributed mode, this could cause a performance decrease. We recommend you to install the pyzmq python package when running in distributed mode.")

[2015-07-03 02:05:26,169] Adrianos-MacBook-Pro.local/INFO/locust.main: Starting web monitor at *:8089

[2015-07-03 02:05:26,170] Adrianos-MacBook-Pro.local/INFO/locust.main: Starting Locust 0.7.3

I'm not using distributed mode.

Also happens when I tried installing in a custom vagrant box (Ubuntu 14.04) I already had on my system. I followed the instructions perfectly from the docs page.

@BafS
Copy link

BafS commented Jan 24, 2017

For info, I had the same info and pip install pyzmq fix it.

@Shuliyey
Copy link

Shuliyey commented Nov 9, 2017

In alpine's case, you might also need g++ installed

e.g. on alpine you need apk add --update g++ (even pyzmq is installed successfully after you installed g++, you still need to keep g++ installed)

if you uninstall g++ after successfully installing pip install pyzmq, that warning also comes up

@cgoldberg
Copy link
Member

that's just a warning... there is no error

@Shuliyey
Copy link

Shuliyey commented Nov 10, 2017

@cgoldberg, it's true it is just a warning, when locust is not running in distributed mode

~ # locust --host=http://qq.com
/usr/local/lib/python3.6/site-packages/locust/rpc/__init__.py:6: UserWarning: WARNING: Using pure Python socket RPC implementation instead of zmq. If running in distributed mode, this could cause a performance decrease. We recommend you to install the pyzmq python package when running in distributed mode.
  warnings.warn("WARNING: Using pure Python socket RPC implementation instead of zmq. If running in distributed mode, this could cause a performance decrease. We recommend you to install the pyzmq python package when running in distributed mode.")
[2017-11-10 21:32:40,422] 6d17d09d802b/INFO/locust.main: Starting web monitor at *:8089
[2017-11-10 21:32:40,423] 6d17d09d802b/INFO/locust.main: Starting Locust 0.8.1

However, if you try running in locustio in distributed mode, when you have this error. In alpine's case it will error out with something like this

~ # locust --host=http://qq.com --master
/usr/local/lib/python3.6/site-packages/locust/rpc/__init__.py:6: UserWarning: WARNING: Using pure Python socket RPC implementation instead of zmq. If running in distributed mode, this could cause a performance decrease. We recommend you to install the pyzmq python package when running in distributed mode.
  warnings.warn("WARNING: Using pure Python socket RPC implementation instead of zmq. If running in distributed mode, this could cause a performance decrease. We recommend you to install the pyzmq python package when running in distributed mode.")
[2017-11-10 21:31:29,226] 6d17d09d802b/INFO/locust.main: Starting web monitor at *:8089
[2017-11-10 21:31:29,227] 6d17d09d802b/ERROR/stderr: Traceback (most recent call last):
[2017-11-10 21:31:29,228] 6d17d09d802b/ERROR/stderr: File "/usr/local/bin/locust", line 11, in <module>
[2017-11-10 21:31:29,229] 6d17d09d802b/ERROR/stderr: 
[2017-11-10 21:31:29,229] 6d17d09d802b/ERROR/stderr: sys.exit(main())
[2017-11-10 21:31:29,230] 6d17d09d802b/ERROR/stderr: 
[2017-11-10 21:31:29,231] 6d17d09d802b/ERROR/stderr: File "/usr/local/lib/python3.6/site-packages/locust/main.py", line 439, in main
[2017-11-10 21:31:29,233] 6d17d09d802b/ERROR/stderr: 
[2017-11-10 21:31:29,233] 6d17d09d802b/ERROR/stderr: runners.locust_runner = MasterLocustRunner(locust_classes, options)
[2017-11-10 21:31:29,234] 6d17d09d802b/ERROR/stderr: 
[2017-11-10 21:31:29,234] 6d17d09d802b/ERROR/stderr: File "/usr/local/lib/python3.6/site-packages/locust/runners.py", line 247, in __init__
[2017-11-10 21:31:29,235] 6d17d09d802b/ERROR/stderr: 
[2017-11-10 21:31:29,236] 6d17d09d802b/ERROR/stderr: self.server = rpc.Server(self.master_bind_host, self.master_bind_port)
[2017-11-10 21:31:29,236] 6d17d09d802b/ERROR/stderr: 
[2017-11-10 21:31:29,237] 6d17d09d802b/ERROR/stderr: File "/usr/local/lib/python3.6/site-packages/locust/rpc/socketrpc.py", line 74, in __init__
[2017-11-10 21:31:29,238] 6d17d09d802b/ERROR/stderr: 
[2017-11-10 21:31:29,238] 6d17d09d802b/ERROR/stderr: self.event_queue = gevent.queue.Queue()
[2017-11-10 21:31:29,239] 6d17d09d802b/ERROR/stderr: 
[2017-11-10 21:31:29,239] 6d17d09d802b/ERROR/stderr: AttributeError
[2017-11-10 21:31:29,240] 6d17d09d802b/ERROR/stderr: :
[2017-11-10 21:31:29,241] 6d17d09d802b/ERROR/stderr: module 'gevent' has no attribute 'queue'
[2017-11-10 21:31:29,241] 6d17d09d802b/ERROR/stderr: 

after g++ is installed, if doesn't error out in distributed mode, also that warning doesn't come up anymore

~ # apk add --update g++
fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/community/x86_64/APKINDEX.tar.gz
(1/16) Installing libgcc (5.3.0-r0)
(2/16) Installing libstdc++ (5.3.0-r0)
(3/16) Installing binutils-libs (2.26-r1)
(4/16) Installing binutils (2.26-r1)
(5/16) Installing gmp (6.1.0-r0)
(6/16) Installing isl (0.14.1-r0)
(7/16) Installing libgomp (5.3.0-r0)
(8/16) Installing libatomic (5.3.0-r0)
(9/16) Installing pkgconf (0.9.12-r0)
(10/16) Installing pkgconfig (0.25-r1)
(11/16) Installing mpfr3 (3.1.2-r0)
(12/16) Installing mpc1 (1.0.3-r0)
(13/16) Installing gcc (5.3.0-r0)
(14/16) Installing musl-dev (1.1.14-r16)
(15/16) Installing libc-dev (0.7-r0)
(16/16) Installing g++ (5.3.0-r0)
Executing busybox-1.24.2-r13.trigger
OK: 186 MiB in 51 packages
~ # locust --host=http://qq.com --master
[2017-11-10 21:34:33,709] 6d17d09d802b/INFO/locust.main: Starting web monitor at *:8089
[2017-11-10 21:34:33,713] 6d17d09d802b/INFO/locust.main: Starting Locust 0.8.1

I believe there're some dependencies in pyzmq, that by install g++ this dependencies is installed

@cgoldberg
Copy link
Member

yikes.. we borked something..

so the warning alone is informational only.. it just tells you it is running the pure python rpc code found in locust/rpc/ instead of using zeromq.

but there is a bug in that rpc code. so, it's only triggered under the following conditions:

  • pyzmq not installed
  • running in distributed mode

it looks the cause was a removed import in #552.

the fix is to re-add the from gevent import queue statement to locsust/runners.py?

@Shuliyey
Here's my best guess regarding g++. You might have had zeromq partially installed but failing to build because it needed g++. so installing g++ triggered it to finish installing zeromq, so the error won't occur.

@cgoldberg cgoldberg reopened this Nov 10, 2017
@Shuliyey
Copy link

Shuliyey commented Nov 11, 2017

thanks for looking into this @cgoldberg , this is my Dockerfile

FROM python:alpine

MAINTAINER "base2Services" <itsupport@base2services.com>

RUN apk --update add tzdata g++ make \
  && pip install locustio \
  && apk del make \
  && rm -rf /var/cache/apk/* /root/__pycache__

ADD locustfile.py /root/
ADD run.sh /root/

ENV MODE ""
ENV ENDPOINT ""

WORKDIR /root

# PORTS
EXPOSE 5557
EXPOSE 8089

CMD ["./run.sh"]

when i change this line

apk del make

to

apk del make g++

this message occurs

/usr/local/lib/python2.7/site-packages/locust/rpc/__init__.py:6: UserWarning: WARNING: Using pure Python socket RPC implementation instead of zmq. If running in distributed mode, this could cause a performance decrease. We recommend you to install the pyzmq python package when running in distributed mode.

as you can see, for some particular reason g++ is required, even after pyzmq is successfully installed, but this particular problem only seem to occur for specific OS. I tried the same thing on debian/ubuntu, after uninstallingg++ pyzmq still works ok, and this error doesn't occur. So it is probably OS related due to different structures/settings of the OS

@cgoldberg
Copy link
Member

after uninstalling g++ pyzmp still works ok

locust doesn't use pyzmp... it uses pyzmq ... so your messages are really confusing.

@Shuliyey
Copy link

Shuliyey commented Nov 11, 2017

@cgoldberg pyzmp is typo, it is pyzmq here

what i'm trying to say here is, this error only seem to apply to specific OS. In this specific case, it's alpine (and possibily macOSX)

on alpine, if you uninstall g++ (after pyzmq and locustio is already successfully installed), for some reason, the OS/locust can't detect pyzmq is installed anymore, and the error in this issue appears,

~ # cat /etc/os-release 
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.4.6
PRETTY_NAME="Alpine Linux v3.4"
HOME_URL="http://alpinelinux.org"
BUG_REPORT_URL="http://bugs.alpinelinux.org"
~ # locust --host=http://qq.com
[2017-11-11 21:34:11,527] bc270b92830e/INFO/locust.main: Starting web monitor at *:8089
[2017-11-11 21:34:11,527] bc270b92830e/INFO/locust.main: Starting Locust 0.8.1
~ # apk del g++
(1/16) Purging g++ (5.3.0-r0)
(2/16) Purging gcc (5.3.0-r0)
(3/16) Purging binutils (2.26-r1)
(4/16) Purging isl (0.14.1-r0)
(5/16) Purging libatomic (5.3.0-r0)
(6/16) Purging pkgconfig (0.25-r1)
(7/16) Purging pkgconf (0.9.12-r0)
(8/16) Purging libc-dev (0.7-r0)
(9/16) Purging musl-dev (1.1.14-r16)
(10/16) Purging libstdc++ (5.3.0-r0)
(11/16) Purging libgcc (5.3.0-r0)
(12/16) Purging binutils-libs (2.26-r1)
(13/16) Purging mpc1 (1.0.3-r0)
(14/16) Purging mpfr3 (3.1.2-r0)
(15/16) Purging gmp (6.1.0-r0)
(16/16) Purging libgomp (5.3.0-r0)
Executing busybox-1.24.2-r13.trigger
OK: 56 MiB in 37 packages
~ # locust --host=http://qq.com
/usr/local/lib/python3.6/site-packages/locust/rpc/__init__.py:6: UserWarning: WARNING: Using pure Python socket RPC implementation instead of zmq. If running in distributed mode, this could cause a performance decrease. We recommend you to install the pyzmq python package when running in distributed mode.
  warnings.warn("WARNING: Using pure Python socket RPC implementation instead of zmq. If running in distributed mode, this could cause a performance decrease. We recommend you to install the pyzmq python package when running in distributed mode.")
[2017-11-11 21:34:48,326] bc270b92830e/INFO/locust.main: Starting web monitor at *:8089
[2017-11-11 21:34:48,326] bc270b92830e/INFO/locust.main: Starting Locust 0.8.1

however if you try and do the same thing on ubuntu/debian, this error doesn't appear.

root@1385d568ec93:/# cat /etc/os-release 
PRETTY_NAME="Debian GNU/Linux 8 (jessie)"
NAME="Debian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=debian
HOME_URL="http://www.debian.org/"
SUPPORT_URL="http://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/
root@1385d568ec93:/# locust --host=http://qq.com --master
[2017-11-11 20:23:04,093] 1385d568ec93/INFO/locust.main: Starting web monitor at *:8089
[2017-11-11 20:23:04,055] 1385d568ec93/INFO/locust.main: Starting Locust 0.8.1
root@1385d568ec93:/# apt-get purge g++ gcc make
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'g++' is not installed, so not removed
Package 'gcc' is not installed, so not removed
Package 'make' is not installed, so not removed
The following packages were automatically installed and are no longer required:
  g++-4.9 libstdc++-4.9-dev
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 14 not upgraded.
root@1385d568ec93:/# locust --host=http://qq.com --master
[2017-11-11 21:25:05,047] 1385d568ec93/INFO/locust.main: Starting web monitor at *:8089
[2017-11-11 21:25:05,050] 1385d568ec93/INFO/locust.main: Starting Locust 0.8.1

so in conclusion, the alpine (removal of g++ causing pyzmq not working correctly) issue should be OS related (as we did the same thing on debian, and it didn't have that issue)

I've created a new issue #680, addressing the python RPC socket not working correctly under distributed mode. I think this ticket can be closed (as it's related, but not really addressing the distributed mode issue on python RPC socket directly), we can address the python RPC socket directly on this separate issue (#680)

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

No branches or pull requests

4 participants