Telegram Group & Telegram Channel
Forwarded from Python Hints
#Quick

داشتم پروژه django شرکت رو می‌خوندم یک مشکل داریم سر بعضی endpointها و برخی تسک‌ها.
اولین کاری کردم این بوده که یک سری دیتا تست با faker بهش دادم مثه loadtest ولی بدون ابزار و بعد هم profiling گرفتم و ذخیره کردم.
چیز جالبی که دیدم؛ پروژه موقع کار کردن با redis به مشکل میخورد.
ولی redis منابعش بیشتر از حد مورد نیازش بود.

حجم دیتاهای تست رو کم کردم و مشکل حل شد؛ توی چندتا تست مختلف که زدم دیدم مسئله و مشگل از سمت پیکج redis هست توی پایتون و راهکار ساده رو هم خود redis داده (هرچند من برعکس بهش رسیدم)

$ pip install "redis[hiredis]"


بجای اینکه برای parse کردن دیتا از python استفاده کنه وقتی hiredis رو نصب کنید از C استفاده می‌کنه (بنچمارکاش هم توی گیت‌هاب hiredis هست ببینید)

مشکل خیلی ساده حل شد؛ ولی برای این حل ساده خیلی زمان و درک profiling لازم بود.

اهمیت profiling



tg-me.com/djangolearn_ir/979
Create:
Last Update:

#Quick

داشتم پروژه django شرکت رو می‌خوندم یک مشکل داریم سر بعضی endpointها و برخی تسک‌ها.
اولین کاری کردم این بوده که یک سری دیتا تست با faker بهش دادم مثه loadtest ولی بدون ابزار و بعد هم profiling گرفتم و ذخیره کردم.
چیز جالبی که دیدم؛ پروژه موقع کار کردن با redis به مشکل میخورد.
ولی redis منابعش بیشتر از حد مورد نیازش بود.

حجم دیتاهای تست رو کم کردم و مشکل حل شد؛ توی چندتا تست مختلف که زدم دیدم مسئله و مشگل از سمت پیکج redis هست توی پایتون و راهکار ساده رو هم خود redis داده (هرچند من برعکس بهش رسیدم)

$ pip install "redis[hiredis]"


بجای اینکه برای parse کردن دیتا از python استفاده کنه وقتی hiredis رو نصب کنید از C استفاده می‌کنه (بنچمارکاش هم توی گیت‌هاب hiredis هست ببینید)

مشکل خیلی ساده حل شد؛ ولی برای این حل ساده خیلی زمان و درک profiling لازم بود.

اهمیت profiling

BY جنگولرن


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/djangolearn_ir/979

View MORE
Open in Telegram


telegram Telegram | DID YOU KNOW?

Date: |

Dump Scam in Leaked Telegram Chat

A leaked Telegram discussion by 50 so-called crypto influencers has exposed the extraordinary steps they take in order to profit on the back off unsuspecting defi investors. According to a leaked screenshot of the chat, an elaborate plan to defraud defi investors using the worthless “$Few” tokens had been hatched. $Few tokens would be airdropped to some of the influencers who in turn promoted these to unsuspecting followers on Twitter.

The S&P 500 slumped 1.8% on Monday and Tuesday, thanks to China Evergrande, the Chinese property company that looks like it is ready to default on its more-than $300 billion in debt. Cries of the next Lehman Brothers—or maybe the next Silverado?—echoed through the canyons of Wall Street as investors prepared for the worst.

telegram from vn


Telegram جنگولرن
FROM USA