You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
request_json=awaitrequest.json() # TODO (ApostaC): merge two awaits into one
after deploying the router server in the k8s environment, i run the stress test by locust but the error below occured at the line.
json.decoder.JSONDecodeError: Unterminated string starting at: line 1 column 992 (char 991)
when i request to the vllm instance directly, it works well.
In addition, when i request to the router only once (not cocurrently), it works well too.
so i think the router is the problem.
i want to know how to receive many cocurrent requests through vllm-router like vllm independent instance.
is there any arguments or required settings for this?
my enviornment is:
nvidia H100 x 8 GPU Server
RHEL 8.8
kubenetes: v1.31.1
vllm-router 0.1.2.dev24+g168f937.d20250413
vllm: v0.7.3 / v0.8.3
import random
import json
import logging
from locust import FastHttpUser, task, between
model_name = "Qwen2.5-72B-Instruct-GPTQ-Int4"
api_key = "api_key"
headers = {
"Authorization": f"Bearer {api_key}",
"Accept": "application/json",
}
import json
with open("data.json", "r", encoding="utf-8") as f:
data = json.load(f)
message_list = [[
{
"role": "system",
"content": """ # INSTRUCTIONS :
Answer the users QUESTION using the DOCUMENT text above.
Keep your answer ground in the facts of the DOCUMENT.
"""
},
{
"role": "user",
"content": x['human'],
},
] for x in data]
class LLMUser(FastHttpUser):
wait_time = between(3, 5)
@task
def predict(self):
payload = {
"model": model_name,
"messages": random.choice(message_list),
"max_completion_tokens":1024,
"temperature":0,
"frequency_penalty":1.2,
"presence_penalty":2
}
response = self.client.request(
method="POST",
url="/v1/chat/completions",
headers=headers,
json=payload,
)
response.raise_for_status()
res = response.json()
logging.info(res['choices'][0]["message"]["content"])
logging.info(res['usage'])
** additional informations **
the deployment yaml files are almost same but i changed the containerPort and added k8s-port arguments in deployment-router.yaml.
each vllm instances are allocated the resources below.
replicaCount: 1
requestCPU: 5
limitCPU: 10
requestGPU: 2
limitGPU: 4
and the router's resource is exactly same with the values.yaml in the helm folder.
i run the test in the local PC so sent the request from the local PC to the H100 Server.
@junggi-hong Hi, I try to reproduce it but it seems good to me, the locust return nothing wrong. According to the error, it seems like there are some json parse errors of your request. Can you check your data and the test file again or maybe curl the router with your data?
first of all, same issue was opened for vllm.
I run the load test to vllm instance server with same data and i also found out that when the load is high like 100 cocurrent requests, vllm instance server also return 415 error in my env too.
however, the point is that my lmstack-router is very fragile. the router returns 415 errors when the load is very low (just 2 cocurrent requests or 2-3 sequential requests without wait time) so same error occured even without the locust load test.
i carefully assumes that the router does not seems to deal with the request asynchronously and return 415 errors for the subsequent requests until theit receives the response from the first request.
my data is quite long (about 5000 length) but i think it's not the memory issue...
@YuhanLiu11 @zerofishnoodles
I found out the difference between default setting of this repo and my custom setting:
the vllm image of this repo is lmcache/vllm-openai and image I used is vllm/vllm-openai.
my environment is air-gapped so I have to use in-house nexus repository for pulling the container images.
Unfortunately, lmcache/vllm-openai images are not supported yet.
Activity
[-]error occured in this code[/-][+]json.decoder.JSONDecodeError[/+][-]json.decoder.JSONDecodeError[/-][+]bug: json.decoder.JSONDecodeError[/+]YuhanLiu11 commentedon Apr 16, 2025
@junggi-hong Thanks for reporting this issue! We will try reproducing on our side. Can you share you stress test script?
junggi-hong commentedon Apr 17, 2025
@YuhanLiu11 sure!
** additional informations **
the deployment yaml files are almost same but i changed the containerPort and added k8s-port arguments in deployment-router.yaml.
each vllm instances are allocated the resources below.
replicaCount: 1
requestCPU: 5
limitCPU: 10
requestGPU: 2
limitGPU: 4
and the router's resource is exactly same with the values.yaml in the helm folder.
i run the test in the local PC so sent the request from the local PC to the H100 Server.
YuhanLiu11 commentedon Apr 17, 2025
Thank you for providing your benchmark script, we will try reproducing on our side.
ruizhang0101 commentedon Apr 18, 2025
@junggi-hong Hi, I try to reproduce it but it seems good to me, the locust return nothing wrong. According to the error, it seems like there are some json parse errors of your request. Can you check your data and the test file again or maybe curl the router with your data?
junggi-hong commentedon Apr 18, 2025
@zerofishnoodles
thank you for the reply!
first of all, same issue was opened for vllm.
I run the load test to vllm instance server with same data and i also found out that when the load is high like 100 cocurrent requests, vllm instance server also return 415 error in my env too.
however, the point is that my lmstack-router is very fragile. the router returns 415 errors when the load is very low (just 2 cocurrent requests or 2-3 sequential requests without wait time) so same error occured even without the locust load test.
i carefully assumes that the router does not seems to deal with the request asynchronously and return 415 errors for the subsequent requests until theit receives the response from the first request.
my data is quite long (about 5000 length) but i think it's not the memory issue...
junggi-hong commentedon Apr 25, 2025
@YuhanLiu11 @zerofishnoodles
I found out the difference between default setting of this repo and my custom setting:
the vllm image of this repo is lmcache/vllm-openai and image I used is vllm/vllm-openai.
my environment is air-gapped so I have to use in-house nexus repository for pulling the container images.
Unfortunately, lmcache/vllm-openai images are not supported yet.
I wonder if this could be the cause of my issue.
fix: Improve JSON parsing robustness under high concurrency
fix: Improve JSON parsing robustness under high concurrency
fix: Improve JSON parsing robustness under high concurrency
fix: Improve JSON parsing robustness under high concurrency
fix: Improve JSON parsing robustness under high concurrency