[openwisp] Suggestions for Optimizing Redis Memory Settings

2024-07-26 Thread Mohammed Ismail
Dear OpenWisp Community,

I hope this message finds you well.

I have been exploring ways to optimize the memory usage of Redis in our
OpenWisp deployments. After seeking advice, it was suggested to me that
adjusting the `maxmemory-policy` and `maxmemory` settings could help
improve performance and stability.

### Suggested Settings

1. **Maxmemory Policy:**
   It was recommended to set the `maxmemory-policy` to `allkeys-lru`. This
policy helps manage memory usage by evicting the least recently used (LRU)
keys when the memory limit is reached.

   **Configuration:**
   ```plaintext
   maxmemory-policy allkeys-lru
   ```

2. **Maxmemory Size:**
   As for the `maxmemory` setting, it was suggested to configure it based
on a percentage of the available RAM on the server. Allocating around 75%
of the total RAM for Redis could be a good starting point, while leaving
the remaining 25% for other processes and the operating system.

   **Configuration:**
   ```plaintext
   maxmemory 
   ```

### Steps to Update Configuration

1. **Edit the Redis Configuration File:**
   Open the Redis configuration file (`/etc/redis/redis.conf`) in a text
editor:
   ```bash
   sudo nano /etc/redis/redis.conf
   ```

2. **Update `maxmemory` and `maxmemory-policy`:**
   Add or update the following lines as per your server's RAM percentage
allocation:
   ```plaintext
   maxmemory 
   maxmemory-policy allkeys-lru
   ```

3. **Save and Exit:**
   Save the changes and exit the text editor. For `nano`, press `Ctrl+X`,
then `Y`, and then `Enter`.

4. **Restart Redis Server:**
   Restart the Redis service to apply the changes:
   ```bash
   sudo systemctl restart redis-server
   ```

I hope these suggestions are helpful. If anyone has further insights or
alternative recommendations, I would greatly appreciate your input.

Best regards, And thanks ChatGPT 😁

Muhammad

-- 
You received this message because you are subscribed to the Google Groups 
"OpenWISP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to openwisp+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/openwisp/CAKOr0YSfWJ810TiJsmfV01wZXy_JOpE0S%2BPEYb30STm57S8PFg%40mail.gmail.com.


Re: [openwisp] Feature proposal : Schedule a reboot upon next device connection on interval.

2024-03-29 Thread Mohammed Ismail
Hi  Federico,

Thank you for the detailed explanation.
I thought it might be useful. I am not in need of it that much.
I understand that you answered so many feature requests and it is
repetitive .. Sorry for that.
I don't like to have my own code for Openwisp. I like to stick to the
production release.
2 years ago i asked to add support for devices for firmware upgrades, and
i added it locally on my server as it is already custom built openwrt for
private hardware.
and it would not help anyone else and you were right about that.
Anyway I am using zerotier VPN for management and when i asked to add
support for it, you were already drawing lines to go for it.
But I had to implement a work-around for managing the Zerotier server. I
chose to set up ztncui <https://github.com/key-networks/ztncui> for that
back then.
Thank you for the work that has been done to implement zerotier last google
summer of code
Looking forward to seeing it when it is production ready.

Regards,
Muhammad



On Fri, Mar 29, 2024 at 7:01 PM Federico Capoano 
wrote:

> Hi Muhammed,
>
> This is one of those custom behaviours which I always recommend users to
> build on their own.
> Given OpenWISP openness and programmability, it's not hard at all to do
> this, the application gives a lot of tools to do that.
> If every time someone needs something like this we'd build it as a core
> feature we'll end up with an unmaintainable pile of code.
> It is possible to implement this in many ways, both on the openwrt side
> with bash or lua or on the server side with python (using django signals,
> the monitoring module has a signal for the health status change and
> openwisp controller has the logic which can be used to send SSH commands).
> I recommend picking what you like most and implement this on your own. I
> honestly think building this on the router is easier.
>
> Regards
> Federico
>
> On Thu, 28 Mar 2024 at 07:48, Mohammed Ismail  wrote:
>
>> Hi
>>
>> It would be useful if we can mark a device for a reboot upon next
>> connection interval
>> Default `option interval '120'`
>>
>> If the device is behind a VPN and it becomes unreachable for any reason.
>> it would be useful for the admin to trigger a reboot upon the next
>> connection attempt from device to the server.
>> so the server side device gets marked for reboot.
>> and from openwisp-config  if the signal received from the server would
>> execute.
>>
>> it could be a whole command to execute on the next connection interval or
>> just a reboot.
>>
>>
>> Best regards.
>> Muhammed Al-Qadhy.
>>
>>
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "OpenWISP" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to openwisp+unsubscr...@googlegroups.com.
>> To view this discussion on the web, visit
>> https://groups.google.com/d/msgid/openwisp/CAKOr0YQRpWw%3DyXAqcXu30jKwPT6H-P5tb9RqYvX5pTjkArFTFw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/openwisp/CAKOr0YQRpWw%3DyXAqcXu30jKwPT6H-P5tb9RqYvX5pTjkArFTFw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "OpenWISP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to openwisp+unsubscr...@googlegroups.com.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/openwisp/CAAGgX6%2By_R6YPCDWt2%3D4BWrCa%2B34y0PihQr1OxJ8omDjhPnaBA%40mail.gmail.com
> <https://groups.google.com/d/msgid/openwisp/CAAGgX6%2By_R6YPCDWt2%3D4BWrCa%2B34y0PihQr1OxJ8omDjhPnaBA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"OpenWISP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to openwisp+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/openwisp/CAKOr0YRq1w8Q64VJ%3D5%3DvUX0Pt0CdQ6fFZVX_D9ZQJ3NdGD2fBw%40mail.gmail.com.


[openwisp] Feature proposal : Schedule a reboot upon next device connection on interval.

2024-03-28 Thread Mohammed Ismail
Hi

It would be useful if we can mark a device for a reboot upon next
connection interval
Default `option interval '120'`

If the device is behind a VPN and it becomes unreachable for any reason.
it would be useful for the admin to trigger a reboot upon the next
connection attempt from device to the server.
so the server side device gets marked for reboot.
and from openwisp-config  if the signal received from the server would
execute.

it could be a whole command to execute on the next connection interval or
just a reboot.


Best regards.
Muhammed Al-Qadhy.

-- 
You received this message because you are subscribed to the Google Groups 
"OpenWISP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to openwisp+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/openwisp/CAKOr0YQRpWw%3DyXAqcXu30jKwPT6H-P5tb9RqYvX5pTjkArFTFw%40mail.gmail.com.


Re: [openwisp] Arabic support

2024-01-14 Thread Mohammed Ismail
Hi Federico,
I mean being able to write Arabic SSIDs only. I know the translation is
massive.
I think it is an encoding issue.

see if i configure an Arabic SSID in openwrt device.
this would be in the /etc/config/wireless
`option ssid 'مقهى الأصدقاء'`
Arabic letters could be read if you download the file to your computer and
open it with notepad++ for instance.
or if you `cat /etc/config/wireless' from an openwrt device.

but if you try to open the file from a program like WinSCP
you will see the line like this >
option ssid 'مقهى الأصدقاء'

Now we get back to openwisp. If I enter arabic ssid  in a configuration
file or configuration template variable
it tries to update the device but the device refuses and gives a
configuration error.

i think it is trying to config SSID as 'مقهى الأصدقاء'


On Sat, Jan 13, 2024 at 8:48 PM Federico Capoano 
wrote:

> Hi Muhammed,
>
> If you mean translations, at the moment we don't have the bandwidth nor
> the necessary funding or structure to maintain translations of the openwisp
> admin.
> If you mean being able to write Arabic SSIDs only, that's a technical
> matter I am not familiar with, if it's not possible we should see what is
> causing the problem and look whether a solution is possible, in that case
> we need more details, eg: what steps can reproduce the problem?
>
> --
> You received this message because you are subscribed to the Google Groups
> "OpenWISP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to openwisp+unsubscr...@googlegroups.com.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/openwisp/CAAGgX6L7phW5KOeTPS5Wr3wLit5R316fNKTuQEHi_as7uMtHoA%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"OpenWISP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to openwisp+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/openwisp/CAKOr0YQB83Os67f9pPbRjH4EXoG2h6H9%3DyuX6DW8SA6PUOirTA%40mail.gmail.com.


Re: [openwisp] OpenWisp Device limit? NginX throwing errors with 700 devices.

2024-01-12 Thread Mohammed Ismail
i had similar thing with uwsgi
i had to manually change config
[uwsgi]
chdir=/opt/openwisp2
uid=www-data
module=openwisp2.wsgi:application
master=True
pidfile=/opt/openwisp2/uwsgi.pid
socket=/opt/openwisp2/uwsgi.sock
processes=12
threads=2
listen=600
harakiri=20
max-requests=5000
vacuum=True
enable-threads=True
env=HTTPS=on
buffer-size=8192
ignore-sigpipe
ignore-write-errors
disable-write-exception

this is my running config for 500+ devices VPS 8 CPUs 8 GB RAM

device monitoring is resource extensive. also take in mind the number of
interfaces being monitored.
for my case i chose only wan interface to monitor.

On Fri, Jan 12, 2024 at 10:50 PM Federico Capoano 
wrote:

> You can increase the intervals in the openwisp-config and
> openwisp-monitoring configuration files, eg:
>
> /etc/config/openwisp (for openwisp-config)
> /etc/config/openwisp-monitoring (for openwisp-monitoring)
>
> See config options:
>
> https://github.com/openwisp/openwisp-config?tab=readme-ov-file#configuration-options
>
> https://github.com/openwisp/openwrt-openwisp-monitoring?tab=readme-ov-file#configuration-options
>
> This will reduce the load on the system.
> In order to increase capacity, there's also other server side tuning you
> can do on the linux system or distribute the load on multiple servers, but
> these steps are complex and the exact way to implement them depends on your
> infrastructure and deployment specific so I cannot explain it here in
> detail.
>
> Best regards
> Federico Capoano
>
>
> On Thu, 11 Jan 2024 at 14:56, Dieter Lubbe  wrote:
>
>> I've installed Openwisp as a POC to monitor our OpenWRT devices on our
>> network.
>> When the device count was less than 100 it ran flawlessly, but ever since
>> more devices started auto registering, Redis and UWSGI has started to
>> consume all available CPU resources.
>>
>> Currently I have 708 devices with more being added daily. These devices
>> are all on the same L2 network.
>>
>> Nginx will generate "502 Bad Gateway" errors unless I clear the Redis DB
>> and restart the services.
>>
>> Where can I change the interval that OpenWisp checks in with devices? I
>> think this might be the cause of the issue.
>>
>> Thanks
>> Dieter
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "OpenWISP" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to openwisp+unsubscr...@googlegroups.com.
>> To view this discussion on the web, visit
>> https://groups.google.com/d/msgid/openwisp/d2ffb115-052b-4307-af2e-340a6afd37fdn%40googlegroups.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "OpenWISP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to openwisp+unsubscr...@googlegroups.com.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/openwisp/CAAGgX6%2BxWvZ9FooKHcQ%3DAWJ4oPyT6ZFmbzqUN%2BSMmP%3DZhbJJBg%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"OpenWISP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to openwisp+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/openwisp/CAKOr0YTHpQEmaq0eyuskxcPjn1N9zpyBZDPoiyafDK%3DG2gSjOA%40mail.gmail.com.