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

Replace Locust load generator's httpUser with fastHttpUser #1973

Closed
antokarant opened this issue Jul 26, 2023 · 5 comments · Fixed by #2495
Closed

Replace Locust load generator's httpUser with fastHttpUser #1973

antokarant opened this issue Jul 26, 2023 · 5 comments · Fixed by #2495
Assignees
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: question Request for information or clarification. Not an issue.

Comments

@antokarant
Copy link

I have a remote kubernetes cluster and trying to use locust either from the load generator pod targeting the frontend or locally targeting the port-forwarded frontend causes an error in the two endpoints mentioned above. Everything else works fine. Creating requests to these endpoints either through postman or through curl does not generate the same error and my first guess was that it had something to do with the session-id cookie. I tried to add to the requests a generated cookie but it did not resolve my issue. The cluster runs the kustomize version so that i can also use Istio. I also tried https requests but that caused an issue in all the endpoints.

image
image

@minherz minherz added type: question Request for information or clarification. Not an issue. priority: p3 Desirable enhancement or fix. May not be included in next release. labels Jul 26, 2023
@minherz
Copy link
Contributor

minherz commented Jul 26, 2023

@antokarant thank you for reporting this to us. We will review your use case and see if we can assist. Can you please share the full request and response bodies for the aforementioned requests?

@minherz minherz self-assigned this Jul 26, 2023
@antokarant
Copy link
Author

Hello @minherz thanks for your reply. The requests are the ones that already exist in the locustfile.py.

When trying with postman or curl I just create a default post request to /setCurrency or /cart/checkout and it works fine without any headers or body.

I also tried it with python requests library and no problem occurred with it either.

In the meanwhile, I found that by replacing HttpUser with FastHttpUser the problem seems to go away so it might be something in the configuration of HttpUser that causes the issue.(a default request flag maybe)

@NimJay
Copy link
Collaborator

NimJay commented Aug 4, 2023

@antokarant thanks for the very clear description of your issue!
@minherz thanks for the quick response and looking into this!

@antokarant:

  • I'm glad you were able to get it working with FastHttpUser instead of the plain HttpUser.
  • According to this doc:
  • So it's likely (as you suggested) that there is some difference in the HTTP requests (e.g., default set of headers) (used by python-requests and geventhttpclient).
  • If you do figure out that difference (and specifically what's causing the 405), let us know — especially if it's something that needs to be fixed on Online Boutique's (microservices-demo's) end.

Questions:

  1. Which version of Online Boutique are you using? The current main branch? Or a specific tag?
  2. Are you able to see exactly what the failing /setCurrency and /cart/checkout requests look like (i.e., list of headers, the body, referrer)? If you're building the microservice Docker images from scratch, perhaps you could add some logs into the frontend to see exactly what the requests to /setCurrency and /cart/checkout look like? Or I wonder if there's a way to log all the details of the requests via Istio.

Thanks!

@NimJay NimJay assigned antokarant and unassigned minherz and NimJay Aug 8, 2023
@antokarant
Copy link
Author

@NimJay thanks for your reply.

  • I am using the main branch and I deployed the project using the Kustomize tool on a local cluster as I also need it to be istio-mesh enabled.

  • To answer your second question, I could not exactly see the request that caused the error. I tried different headers using python-requests but I could not find the solution.

Question:
I found out that kustomize uses container images already on google cloud so I can not find a way to change the requests inside the load-generator pod(the proposed fix using FastHttpUser was tested while using Locust from my local machine to access the cluster). I was wondering if there is a way to deploy using skaffold but also to have istio installed. Or if there is another workaround to fix my issue.

Thanks!

@bourgeoisor bourgeoisor changed the title /setCurrency and /cart/checkout locust testing causes HTTPError('405 Client Error: Method Not Allowed for url: ..) Replace Locust load generator's httpUser with fastHttpUser Apr 18, 2024
@bourgeoisor
Copy link
Member

@antokarant I've just merged a fix for this, which should be available through skaffold run immediately, and as an official release for next version. Let me know this solves (or not) your problem!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants