Support Offline: Mon - Fri / 08:00am - 05:00pm (GMT +7)
Your Time: Our Time:

file Weather module requests causing High CPU on server

More
3 years 11 months ago #39953 by Jocelyn Garner
My client has been complaining that her website has slowed down significantly, sometimes timing out. While investigating the issue, I've discovered that your extension is issuing too many requests to your default location and generating the following error:

PHP Warning: file_get_contents( ipinfo.io/167.114.118.240/json ): failed to open stream: HTTP request failed!
HTTP/1.0 429 Too Many Requests\r\n in [filelocation]/grantcountybeat.com/modules/mod_jux_weather_forecast/tmpl/default.php on line 47

Here's the code leading up to line 47:
if(!empty($_SERVER['HTTP_CLIENT_IP'])){
    //ip from share internet
    $ip = $_SERVER['HTTP_CLIENT_IP'];
}elseif(!empty($_SERVER['HTTP_X_FORWARDED_FOR'])){
    //ip pass from proxy
    $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
}else{
    $ip = $_SERVER['REMOTE_ADDR'];
}

$details = json_decode(file_get_contents("http://ipinfo.io/{$ip}/json"));

The correct location is in fact set within the module, and we do see the correct weather information on the site. So why is your code repeatedly requesting data for a default location? Can you help us solve this problem?

Toolie

Please Log in or Create an account to join the conversation.

More
3 years 11 months ago #39955 by HaiND
Hi
You can provide information login back-end
I will check it for you
Thanks

Best Regards
--HaiND--

Please Log in or Create an account to join the conversation.

More
3 years 11 months ago #39963 by Jocelyn Garner
Before handing over super-admin credentials to someone I do not know, are there other things you'd like to see, such as the settings in the module? My client is skittish about handing over credentials to anyone but me.

What can I supply to you via screenshots?

Please Log in or Create an account to join the conversation.

More
3 years 11 months ago #39972 by HaiND
Hi
I also don't know why the code is causing problems with the site, so I wanted to visit it to check it, I have never had this problem.

Best Regards
--HaiND--

Please Log in or Create an account to join the conversation.

More
3 years 10 months ago - 3 years 10 months ago #40030 by Jocelyn Garner
I've spent the last month eliminating everything else, including a complete change of website template, and your module is the last item that's still causing High CPU usage due to many, many PHP errors. These are the most recent 5 entries:
[Sun Jan 31 08:18:04.972372 2021] [proxy_fcgi:error] [pid 25317:tid 140164563195648] [client 66.249.79.251:46881] AH01071: Got error 'PHP message: PHP Warning:  file_get_contents(http://ipinfo.io/66.249.79.251/json): failed to open stream: HTTP request failed! HTTP/1.0 429 Too Many Requests\r\n in [server-location]/modules/mod_jux_weather_forecast/tmpl/default.php on line 47'
[Sun Jan 31 08:18:05.388386 2021] [proxy_fcgi:error] [pid 25317:tid 140164538017536] [client 66.249.79.247:62666] AH01071: Got error 'PHP message: PHP Warning:  file_get_contents(http://ipinfo.io/66.249.79.247/json): failed to open stream: HTTP request failed! HTTP/1.0 429 Too Many Requests\r\n in [server-location]/modules/mod_jux_weather_forecast/tmpl/default.php on line 47'
[Sun Jan 31 08:18:05.892124 2021] [proxy_fcgi:error] [pid 24412:tid 140164420519680] [client 66.249.79.251:59639] AH01071: Got error 'PHP message: PHP Warning:  file_get_contents(http://ipinfo.io/66.249.79.251/json): failed to open stream: HTTP request failed! HTTP/1.0 429 Too Many Requests\r\n in [server-location]/modules/mod_jux_weather_forecast/tmpl/default.php on line 47'
[Sun Jan 31 08:18:06.437739 2021] [proxy_fcgi:error] [pid 24412:tid 140164252665600] [client 66.249.79.249:38231] AH01071: Got error 'PHP message: PHP Warning:  file_get_contents(http://ipinfo.io/66.249.79.249/json): failed to open stream: HTTP request failed! HTTP/1.0 429 Too Many Requests\r\n in [server-location]/modules/mod_jux_weather_forecast/tmpl/default.php on line 47'
[Sun Jan 31 08:18:06.957325 2021] [proxy_fcgi:error] [pid 24412:tid 140164151953152] [client 66.249.79.247:36474] AH01071: Got error 'PHP message: PHP Warning:  file_get_contents(http://ipinfo.io/66.249.79.247/json): failed to open stream: HTTP request failed! HTTP/1.0 429 Too Many Requests\r\n in [server-location]/modules/mod_jux_weather_forecast/tmpl/default.php on line 47'

I have had to completely disable the module as a result. Now that I am certain yours is the last issue, please examine the code and recommend a solution. I need a valid email address for you so that I can set up a super admin user for your use. Please contact me at the email in my profile.
Last edit: 3 years 10 months ago by Jocelyn Garner.

Please Log in or Create an account to join the conversation.

More
3 years 10 months ago #40037 by HaiND
Hi
You can send information login back-end via email: This email address is being protected from spambots. You need JavaScript enabled to view it.
I will check it for you
Thanks

Best Regards
--HaiND--

Please Log in or Create an account to join the conversation.

More
3 years 10 months ago #40041 by Jocelyn Garner
Thank you for your prompt response. I have created a user for you and the system has emailed the information to you. Please let me know that you have received it. Thanks!

Please Log in or Create an account to join the conversation.

More
3 years 10 months ago #40042 by HaiND
Hi
I haven't figured out how to fix the problem right now and I don't see any client with the same problem, I will try to fix it in the future.
Please use "Input Address" and delete code have problem

Best Regards
--HaiND--

Please Log in or Create an account to join the conversation.

More
3 years 10 months ago - 3 years 10 months ago #40061 by Jocelyn Garner
I am already using the Input Address option with the correct latitude and longitude. If you are not going to fix this now, then I want my money back. Your module is costing us money because it reports so many errors that our PHP works overtime reporting them. Here's what I pulled from the logs just now:
[Sat Feb 06 03:27:36.467159 2021] [proxy_fcgi:error] [pid 4599:tid 139619907655424] [client 66.249.79.251:38651] AH01071: Got error 'PHP message: PHP Warning:  file_get_contents(http://ipinfo.io/66.249.79.251/json): failed to open stream: HTTP request failed! HTTP/1.0 429 Too Many Requests\r\n in [server-location]/modules/mod_jux_weather_forecast/tmpl/default.php on line 47'
[Sat Feb 06 03:27:36.756167 2021] [proxy_fcgi:error] [pid 4436:tid 139619739801344] [client 73.242.191.127:52825] AH01071: Got error 'PHP message: PHP Warning:  file_get_contents(http://ipinfo.io/73.242.191.127/json): failed to open stream: HTTP request failed! HTTP/1.0 429 Too Many Requests\r\n in [server-location]/modules/mod_jux_weather_forecast/tmpl/default.php on line 47', referer: https://www.newsbreakapp.com
[Sat Feb 06 03:27:37.555919 2021] [proxy_fcgi:error] [pid 4436:tid 139619529983744] [client 66.249.79.249:50832] AH01071: Got error 'PHP message: PHP Warning:  file_get_contents(http://ipinfo.io/66.249.79.249/json): failed to open stream: HTTP request failed! HTTP/1.0 429 Too Many Requests\r\n in [server-location]/modules/mod_jux_weather_forecast/tmpl/default.php on line 47'
[Sat Feb 06 03:27:37.709503 2021] [proxy_fcgi:error] [pid 4436:tid 139619471234816] [client 185.191.171.36:41360] AH01071: Got error 'PHP message: PHP Warning:  file_get_contents(http://ipinfo.io/185.191.171.36/json): failed to open stream: HTTP request failed! HTTP/1.0 429 Too Many Requests\r\n in [server-location]/modules/mod_jux_weather_forecast/tmpl/default.php on line 47'
[Sat Feb 06 03:27:38.241515 2021] [proxy_fcgi:error] [pid 3631:tid 139619832121088] [client 66.249.79.253:61358] AH01071: Got error 'PHP message: PHP Warning:  file_get_contents(http://ipinfo.io/66.249.79.253/json): failed to open stream: HTTP request failed! HTTP/1.0 429 Too Many Requests\r\n in [server-location]/modules/mod_jux_weather_forecast/tmpl/default.php on line 47'
[Sat Feb 06 03:27:38.512991 2021] [proxy_fcgi:error] [pid 4599:tid 139619790157568] [client 66.249.79.253:39494] AH01071: Got error 'PHP message: PHP Warning:  file_get_contents(http://ipinfo.io/66.249.79.253/json): failed to open stream: HTTP request failed! HTTP/1.0 429 Too Many Requests\r\n in [server-location]/modules/mod_jux_weather_forecast/tmpl/default.php on line 47'

This is an Amazon Web Services (AWS) server with a Bitnami LAMP stack (bitnami.com). This is not your typical shared hosting site, which may explain why you've not previously encountered this error.

I've been in the software industry for over 30 years. What serious developers do when faced with something they don't understand is to dig in, learn what you need to learn, and fix the problem to serve your customers. I challenge you to do the right thing and figure it out now. I'm giving you a chance now before I make an unfavorable review on the Joomla Extensions directory.

What is your decision?
Last edit: 3 years 10 months ago by Jocelyn Garner.

Please Log in or Create an account to join the conversation.

More
3 years 10 months ago #40069 by HaiND
Hi
We're trying to fix it because somehow it just happens to you
Now you can access in file: ...\modules\mod_jux_weather_forecast\tmpl\default.php
and disable from line 37 to line 47

Best Regards
--HaiND--

Please Log in or Create an account to join the conversation.

Moderators: Jackie
Time to create page: 0.145 seconds
Powered by Kunena Forum