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

slowness when writing response text to file, working in one environment but not the other #6854

Closed
hamiltonhall opened this issue Dec 12, 2024 · 1 comment
Labels
actions/autoclose-qa Used for automation to auto-close an issue Question/Not a bug

Comments

@hamiltonhall
Copy link

Please refer to our Stack Overflow tag for guidance.
Facing a weird issue saving response text for a file. This is working fine in Azure linux but not OCI linux. It took 3 minutes to write to file on OCI linux and only a second in Azure linux.

OCI Linux version:
NAME="Oracle Linux Server"
VERSION="8.10"

Azure Linux version:
NAME="Red Hat Enterprise Linux Server"
VERSION="7.9 (Maipo)"

Slow environment, ( OCI Linux)
2024-12-12 17:21:45,545 - 41454 - INFO - file receive starts ::
2024-12-12 17:21:59,420 - 41454 - INFO - file receive success ::
2024-12-12 17:21:59,420 - 41454 - INFO - file read starts ::
2024-12-12 17:25:00,603 - 41454 - INFO - file read completes
::
2024-12-12 17:25:00,785 - 41454 - INFO - file write success :: request_test.xml.gz

Working environment (Azure Linux)
2024-12-12 15:44:11,305 - 21602 - INFO - file receive starts ::
2024-12-12 15:44:25,811 - 21602 - INFO - file receive success ::
2024-12-12 15:44:25,812 - 21602 - INFO - file read starts ::
2024-12-12 15:44:35,759 - 21602 - INFO - file read completes ::

2024-12-12 15:44:41,446 - 21602 - INFO - file write success :: request_test.xml.gz

Sudo code

res = requests.request("GET", url, headers = headers, auth=HTTPBasicAuth(by_username,by_password), data=payload)

logging.info("file receive success :: ")

if str(res.status_code) == "200":
logging.info("file read starts :: " )
file_data = res.text.encode('utf8')
#file_data = res.text
logging.info("file read completes :: " )

    #fileName = ftp_path + 'incoming\\' + '_'.join(file) + '.xml.gz'

fileName = 'request_test' + '.xml.gz'

#with gzip.open(fileName, "wb") as f:
with open(fileName, "wb") as f:
f.write(file_data)
#f.write(res.text.encode('utf8'))

@hamiltonhall hamiltonhall added actions/autoclose-qa Used for automation to auto-close an issue Question/Not a bug labels Dec 12, 2024
Copy link

As described in the template, we won't be able to answer questions on this issue tracker. Please use Stack Overflow

@github-actions github-actions bot locked as off-topic and limited conversation to collaborators Dec 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
actions/autoclose-qa Used for automation to auto-close an issue Question/Not a bug
Projects
None yet
Development

No branches or pull requests

1 participant