دعم الموقع

Hi, I having problems with responses time. Usually 0.5s per call, is normal this time?

If I put the URL in Chrome/Firefox load instantly, but with cURL in PHP takes much time.

What can be causing this? How can i solve?

Thanks.

6 ردود (على هذه الصفحة 1 من 1)

Jump to last post

Hi Criops,

My instinct would be to say it sounds like something DNS related. Do you have terminal access to the machine you're using cURL on? You can execute this command:

curl -vv -L http://api.themoviedb.org/3/tv/1396?api_key=###

The first block returned will be cURL trying to connect to the server, does it seem to be stalling out with that .5s there?

I don't see any oddness reported by our Pingdom page either.

I have no terminal access.

http://i.gyazo.com/05a05ed94cef8847fe7e9cc6c1eecf35.png

I'm from Latin America, maybe it's that the cause?

Location will have some affect no doubt (our servers are all hosted with AWS) but the website and API are all in the same location, so do you see the same behaviour with the website?

I'm leaning towards DNS, especially since I am pretty sure cURL doesn't cache the DNS hostname where your browser would.

Without terminal access though, there's not going to be much you can do. I would have suggested using a different DNS server, and/or tracerouting from the box to see what is going on. Unfortunately, if you don't have access to any of those tools there isn't a whole lot more I can suggest.

I "solved" this by saving the results, and using "append_to_response" (to reduce from 5 calls to 2). Now the problem its only the first call, but work better than before.

¿Its allowed save the results?

Thanks.

Both of those are great options. Yes, caching the data locally is fine.

Cheers.

Before caching:

http://i.gyazo.com/05a05ed94cef8847fe7e9cc6c1eecf35.png

After caching, add cloudflare, and start use "append_to_response":

http://i.gyazo.com/eee2c9a3f249ab0c8682a9e3ccfc6566.png

Average 730ms to 380ms (in 200 pages).

Thanks.

لم تجد الفلم أو المسلسل ؟ سجل دخولك و انشئها

عام

s ركز شريط البحث
p افتح قائمة الملف الشخصي
esc اغلق النافذة المفتوحة
? افتح نافذة اختصارات لوحة المفاتيح

على كافة صفحات الوسائط

b ارجع للخلف (او للصفحة الام عند التطبيق)
e انتقل لصفحة التعديل

على كافة صفحات موسم المسلسل

(السهم الايمن) انتقل للموسم التالي
(السهم الايسر) انتقل للموسم السابق

على كافة صفحات حلقة المسلسل

(السهم الايمن) انتقل للحلقة التالية
(السهم الايسر) انتقل للحلقة السابقة

على كافة صفحات الصور

a افتح صفحة اضافة الصورة

على كافة صفحات التعديل

t افتح محدد الترجمة
ctrl+ s ارسال النموذج

على صفحات المناقشة

n انشى نقاش جديد
w تبديل حالة المتابعة
p تبديل عام / خاص
c تبديل اغلاق / فتح
a افتح الانشطة
r رد على النقاش
l انتقل لأخر رد
ctrl+ enter أرسل رسالتك
(السهم الايمن) الصفحة التالية
(السهم الايسر) الصفحة السابقة

الاعدادات

هل تريد تقييم او اضافة هذا العنصر للقائمة؟

تسجيل الدخول