I have put a .txt file with MB templates in the template folder. I have that file uploaded to my server via ftp.
And then I have the txt file “read” by a php file.
Since I have no idea of the workload that entails, I'm wondering the following.
What is more efficient. Upload 2 or 3 smaller txt files, and have them handled by a (different) php file. Or just upload 1 larger and more extensive txt file.
I mean, with the large file I don't always need all the info. That's why I thought to split. if you have a bigger file each e.g. 2 minutes upload and read and not all info is needed..... But is that also useful/efficient?
Bart
Handling of a template file
Moderator: Mattk
Re: Handling of a template file
I guess you want to know what the workload at the server end is
(your local workload you should be able to determine by some resource monitor tool).
Before you speak of a quantifiable workload, you need to know what the capacity/power of your remote server is.
And, how many bytes are you uploading and are being remotely processed.
Just to avoid that we speak of a workload which disappears in the white noise/background noise of the server.
About how many Megabytes are you speaking ?
(your local workload you should be able to determine by some resource monitor tool).
Before you speak of a quantifiable workload, you need to know what the capacity/power of your remote server is.
And, how many bytes are you uploading and are being remotely processed.
Just to avoid that we speak of a workload which disappears in the white noise/background noise of the server.
About how many Megabytes are you speaking ?
WH4000SE 1.6.6/1 x DP1500/4 x GW1000 1.7.7/GW1100 2.3.0/HP1000SE Pro 1.9.3//2 x WH2650 1.7.7/GW2000 3.1.0
2xMeteobridge Pro [B+R] 15161, 2xRPi4B-2GB/16/32 3139,VM128 1704
Weather Landing page: https://meshka.eu
Ecowitt WiKi: https://meshka.eu/Ecowitt/dokuwiki
2xMeteobridge Pro [B+R] 15161, 2xRPi4B-2GB/16/32 3139,VM128 1704
Weather Landing page: https://meshka.eu
Ecowitt WiKi: https://meshka.eu/Ecowitt/dokuwiki
Re: Handling of a template file
Perhaps workload is too strong a word. I'll explain a little better. I didn't do that well enough.
Suppose I put a text file in the template directory with 210 lines (lines are the sensor variables).
Then with the correct command in the MB a file will appear on the server.
I have that file read through a PHP file... But I only need 24 lines of the 210 lines in that particular (example) file.
So....
I refresh that file with an MB service every 2 minutes. The PHP reads it for example every 5 minutes. So it reads 210 lines but only needs 24.
Isn't that nonsensical and isn't it better to upload a text file with those 24 lines? And then some other files that also only have to read what is needed. If you add up the lines of all those php files, there are 210 in this example.
Or is it no effort to read through 210 lines each time? Every 5, or "worse" every 30 seconds?
Bart
Suppose I put a text file in the template directory with 210 lines (lines are the sensor variables).
Then with the correct command in the MB a file will appear on the server.
I have that file read through a PHP file... But I only need 24 lines of the 210 lines in that particular (example) file.
So....
I refresh that file with an MB service every 2 minutes. The PHP reads it for example every 5 minutes. So it reads 210 lines but only needs 24.
Isn't that nonsensical and isn't it better to upload a text file with those 24 lines? And then some other files that also only have to read what is needed. If you add up the lines of all those php files, there are 210 in this example.
Or is it no effort to read through 210 lines each time? Every 5, or "worse" every 30 seconds?
Bart
Re: Handling of a template file
I'm feeding the Weather34 template from Meteobridge.
It contains 190+ sensor variables.
They are posted every 15 seconds.
The template resides on my NAS and on a remote server in the web (=> 2 separate posts).
Neither my NAS (a QNAP TS-453A with 8 GB RAM/32 TB disk space [conventional HDDs]) nor the remote server are very impressed by the load generated by the API posts (php files processing the post in the API format).
I assume that over some period of time all your 210 variables are needed - otherwise why posting that many ?
Of course there may be a dependency from the php script end, depending on how the processing is programmed.
From a software design point of view it might be easier to maintain the software when you have functionalities clustered.
E.g. have different pieces of software (e.g. php scripts) process different data for different purposes at different times.
That would be rather good practise.
It all comes down to the design of your application - but rather from a maintenance point of view than from a workload point of view
(even though there might be scenarios where this also becomes important - but then we are talking of different orders of magnitude).
It contains 190+ sensor variables.
They are posted every 15 seconds.
The template resides on my NAS and on a remote server in the web (=> 2 separate posts).
Neither my NAS (a QNAP TS-453A with 8 GB RAM/32 TB disk space [conventional HDDs]) nor the remote server are very impressed by the load generated by the API posts (php files processing the post in the API format).
I assume that over some period of time all your 210 variables are needed - otherwise why posting that many ?
Of course there may be a dependency from the php script end, depending on how the processing is programmed.
From a software design point of view it might be easier to maintain the software when you have functionalities clustered.
E.g. have different pieces of software (e.g. php scripts) process different data for different purposes at different times.
That would be rather good practise.
It all comes down to the design of your application - but rather from a maintenance point of view than from a workload point of view
(even though there might be scenarios where this also becomes important - but then we are talking of different orders of magnitude).
WH4000SE 1.6.6/1 x DP1500/4 x GW1000 1.7.7/GW1100 2.3.0/HP1000SE Pro 1.9.3//2 x WH2650 1.7.7/GW2000 3.1.0
2xMeteobridge Pro [B+R] 15161, 2xRPi4B-2GB/16/32 3139,VM128 1704
Weather Landing page: https://meshka.eu
Ecowitt WiKi: https://meshka.eu/Ecowitt/dokuwiki
2xMeteobridge Pro [B+R] 15161, 2xRPi4B-2GB/16/32 3139,VM128 1704
Weather Landing page: https://meshka.eu
Ecowitt WiKi: https://meshka.eu/Ecowitt/dokuwiki
Re: Handling of a template file
You helped me. Aside from the fact that I'm only just beginning to understand (php and all) how it can work, you've given me input to think further about the interrelationship of things. And last but not least, the ever-present challenge is to find the balance between efficiency, practicality and logical working.
thanks,
Bart

thanks,
Bart