Welcome to the Cumulus Support forum.

Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080

Slow connection from apache to cumulus MX server

From build 3044 the development baton passed to Mark Crossley. Mark has been responsible for all the Builds since. He has made the code available on GitHub. It is Mark's hope that others will join in this development, but at the very least he welcomes your ideas for future developments (see Cumulus MX Development suggestions).

Moderator: mcrossley

Post Reply
Atlas
Posts: 43
Joined: Wed 04 Jun 2014 3:36 pm
Weather Station: Davis Vantage Pro2 Plus
Operating System: Win 10 Pro x64 4 GB RAM
Location: Murcia, Spain

Slow connection from apache to cumulus MX server

Post by Atlas »

Hi

I have Cumulus MX and my website webserver on the same PC and I have been using a PHP script with file_get_contents catching http://127.0.0.1:8998/api/data/currentdata to feed my web site gauges page but in the latest MX versions the response is very slow, around 15 secs to get the data.
Directly in the browser there is no problem but with file_get_contents with php and apache in the same PC there is that 15 secs delay.

With previous MX versions (3017 for example) didn't happen that problem.

I know that MX uses a C library called EmbedIO to create its web server.

Some hints to know how to fix the problem ?? I have been trying to change http headers in the file_get_contents petition with no success. Something has changed in the MX server ??

Thanks
Image
Davis Vantage Pro 2 Plus
https://www.meteoarchena.es
User avatar
mcrossley
Posts: 14388
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Slow connection from apache to cumulus MX server

Post by mcrossley »

Something may have changed in EmbedIO, but nothing in CMX.

A quick search found this which *sounds* relevant even though it is old... https://stackoverflow.com/questions/362 ... g-full-url
Atlas
Posts: 43
Joined: Wed 04 Jun 2014 3:36 pm
Weather Station: Davis Vantage Pro2 Plus
Operating System: Win 10 Pro x64 4 GB RAM
Location: Murcia, Spain

Re: Slow connection from apache to cumulus MX server

Post by Atlas »

Thanks for answering

Searching for answers on google I reached the same link with no success

I've put curl and problem fixed

Code: Select all


<?php

header("Content-Type: text/plain");

$url = 'http://127.0.0.1:8998/api/data/currentdata';
 
$curl = curl_init();
 
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
 
$data = curl_exec($curl);
 
curl_close($curl);

echo $data;

?>

https://www.meteoarchena.es/gauges.html

Hope that it helps someone.
Image
Davis Vantage Pro 2 Plus
https://www.meteoarchena.es
Post Reply