Skip to content
This repository has been archived by the owner on May 11, 2024. It is now read-only.

Load tests #38

Merged
merged 3 commits into from
Feb 26, 2019
Merged

Load tests #38

merged 3 commits into from
Feb 26, 2019

Conversation

mareklevv
Copy link
Contributor

Summary of changes:

  • add Locust and other scripts required to launch load tests
  • change way of transpose in grpc client

response_length=response.ByteSize())


class MyLocust(Locust):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you change names started with My...? i.e. to LocustTaskSet, LocustTests, LocusClass etc


class MyTaskSet(TaskSet):
data_for_requests = []
GRPC_ADDRESS = os.environ.get('GRPC_ADDRESS', "URL")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you consider getting all these values from args, not from envs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about it, but locust doesn't provide any custom arguments interface so i would have to write some workarounds.
locustio/locust#65

Copy link
Contributor

@mzegla mzegla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just a few suggestions 😄

````
GRPC_ADDRESS # address to grpc endpoint
MODEL_NAME = # model name; default value=resnet
TENSOR_NAME # input tensor name' default value=in
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
TENSOR_NAME # input tensor name' default value=in
TENSOR_NAME # input tensor name; default value=in

tf_contrib_util.make_tensor_proto(self.imgs, shape=(self.imgs.shape)))

def on_stop(self):
print("Tasks was stopped")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
print("Tasks was stopped")
print("Tasks have been stopped")

A script was prepared to launch specific amount of locust instances, by passing integer to bash script.
Without passing any parameter script will launch Locust in distributed mode with 2 slaves.
If you want to perform as many RPS as possible we recommend to spawn 1 slave for 1 CPU core.
Also this script creates temporary file `pid_locust` which keep PID of processes launched by this script.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Also this script creates temporary file `pid_locust` which keep PID of processes launched by this script.
Also this script creates temporary file `pid_locust` which keeps PID of processes launched by this script.

## Stop Locust

We run all instances as background process, so to stop load tests you can use our script ```./stop_locust```
, which also remove temporary file created earlier or read PIDs in `pid_locust` file and simply kill processes listed in that file.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
, which also remove temporary file created earlier or read PIDs in `pid_locust` file and simply kill processes listed in that file.
, which also removes temporary file created earlier or read PIDs in `pid_locust` file and simply kill processes listed in that file.



## Description
Script available under this directory allow users to execute on their own load tests. Prepared [Locust class](image_locust.py)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Script available under this directory allow users to execute on their own load tests. Prepared [Locust class](image_locust.py)
Script available under this directory allows users to execute their own load tests. Prepared [Locust class](image_locust.py)


## Description
Script available under this directory allow users to execute on their own load tests. Prepared [Locust class](image_locust.py)
on start loads environment variables and images also create grpc stub. In hatching phase this client only perform request to GRPC service using earlier loaded images.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
on start loads environment variables and images also create grpc stub. In hatching phase this client only perform request to GRPC service using earlier loaded images.
loads configuration from environment variables and creates grpc stub in `on start` method. In hatching phase this client only performs requests to GRPC service using earlier loaded images.

@pawel-pieniazek pawel-pieniazek merged commit 5384e82 into master Feb 26, 2019
@pawel-pieniazek pawel-pieniazek deleted the locust branch February 26, 2019 08:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants