What's new

FTP Concurrent Users Maxed Out (Solved)

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

hoang51

Occasional Visitor
Update 12/10/2017: Issue resolved, scroll down to post #5 for solution.

Summary: Experiencing problems with Wi-Fi surveillance cameras choked by FTP Share when recording videos to USB HDD on RT-AC68R.

I'm not sure if anybody experienced the current situation I'm having. I have bought a bunch of Amcrest surveillance cameras to use (eight to be exact). The cameras are all Amcrest ProHD 1080P WiFi Wireless IP Security Camera - 1080P (1920TVL), model IP2M-841 (I have both IP2M-841W for white, IP2M-841B for black). Amcrest cameras have the options to save recorded videos onto SD card, FTP, NAS, and Amcrest Cloud. I liked the SD card and FTP options. When I went to configure the FTP service with my ASUS RT-AC68R router, I ran into problems.

When I looked at the videos saved onto my portable HDD attached via USB to the router, they were broken into chunks, gaps in event recordings, video ending in the middle of an event, incomplete videos, etc... In other words, the videos did not record in 8 minute chunks that they were defaulted to (pack duration under record control section in Amcrest settings). At first, I thought that the cameras were not configured correctly to continuously record 24/7 (General) and instead picking up motion detection only. But this wasn’t the case because I tested it via SD card and disabled all but one camera and it streamed the video fine to the HDD the way it should be. Then I thought maybe the bandwidth was insufficient because I'm already having 4 cameras attached to my 2.4 GHz and saturating the bandwidth. I checked under Traffic Analyzer and the bandwidth is still available and have room to accommodate more data. I do have the option to adjust the bitrate of the videos to lower the data utilization at the cost of video quality. I even thought it was a NTFS vs FAT32 file system where the router could not handle the read/write functions. It turned out that NTFS and FAT32 both experienced the same problem. I then played around with FTP concurrent users that was defaulted to 5. I played with the values at 1 and 10.

I saw in the general log “kernel: TCP: time wait bucket table overflow” and looked up that problem. I realized that the main problem after narrowing it down to is the problem is originating with the FTP server from the Asus router. When I have 2 Amcrest cameras enabled to FTP their recorded videos, they were working fine when I have FTP concurrent users set at 10. When I added the third Amcrest camera, that’s when everything starts to break down – all the videos are no longer recorded to the hard drive on the network and disconnections in the videos are apparent. It seems that the FTP concurrent users is the limiting factor.

Amcrest doesn’t have any options to limit the number of concurrent connections found in their menu, so no options to limit from Amcrest point. Now, as for the Asus FTP server, I know in the past, the default and max value was set at 5 and at some point, it was increased to 10. @RMerlin , is there any way to increase the max number of FTP concurrent users beyond 10? I’m trying to avoid running a standalone FTP server if the Asus RT-AC68R could accept the change. I see that the CPU utilizations are not bad at all – one core is probably at max 15% for 2 Amcrest cameras connected while the other core is even less than 5%.

If it helps, I’m currently running with Merlin’s firmware 380.69_alpha1-g4e73555.
 
Last edited:
Not the right tool for the job...

Check out QNAP -- they have support for the Amcrest Cameras, and I would think Synology likely does as well...

For QNAP...

https://www.qnap.com/en-us/compatibility-surveillance/?brand=Amcrest

Thanks for letting me know of other products that may handle the recording. Although it's nice to throw more money at things to make it work, I'd like to make sure what I have around the house is capable of handling the surveillance cameras such as stacks of unused HDDs and other hardwares (Asus RT-AC56U, Linksys NSLU2).
 
Before throwing money at a NAS from QNAP or Synology - contact their pre-sales teams and explain the requirements and equipment, and they can get you sorted.

Syno and QNAP also have community forums that you can reach out to.
 
Solution found! Before anybody decides to spend their hard earned money and buy a NAS or do anything else wise, I have found the solution to increase the maximum number of concurrent connections under FTP Share. I came across this post: Linux-prompt command to increase Samba max connections? found somewhere else on this forum. Thanks to @john9527 at post #11 for detailing out how to resolve the max users at 5 and bumping it up to 10. I end up substituting 10 for 99 (nvram set st_max_user=99). Here's the instructions found in post #11, abridged form:

For casual use, I'd recommend you just use telnet to make the changes.

- If telnet is not enabled on the router go to the Administration/System page
(default is http://192.168.1.1/Advanced_System_Content.asp)
and click the radio button to enable telnet, and then click Apply to save the change.

- Open a telnet session on your computer

If you are on windows, this will tell you how to install telnet....
http://social.technet.microsoft.com/wiki/contents/articles/910.windows-7-enabling-telnet-client.aspx

If Linux, telnet is included in all distributions. Open a terminal window and type telnet

- Once you get the telnet prompt enter

o 192.168.1.1 (that's the letter 'o' for open)
You will then be prompted for your logon info (same info as you use to logon to the router gui)

Once you are logged into telnet enter:

nvram set st_max_user=10
nvram commit
reboot

This will stay active until you need to change something on either the Samba or FTP pages, at which point
it won't let you save the changes until you reduce the limit to 5 or less. Then you will need to perform
the above procedure again to set the limit back to 10.

Remember to substitute nvram set st_max_user=10 with something like nvram set st_max_user=99. I haven't tried 100, but I'm not likely to ever need over 100 since I only have 8 cameras and probably need about 40 concurrent connections to allow these Amcrest Wifi cameras to FTP stream it to the HDD correctly. @RMerlin , I hope in the future, the maximum value of 10 should be hard coded to at least 99 (or more) for those who know what they're doing. I know you have said it in the past that more than 10 isn't performance worthy for an ASUS router and best to get a NAS... I'm currently monitoring the CPU/RAM usage on Network Map and so far, 3 cameras each streaming at 1080P @ 30fps, H.264H, VBR, quality set at 6 (best), stream limit of 8,192 Kb/s, to the USB HDD are not eating up resources from RT-AC68R and not preventing the router from being responsive for other activities.

I'll update this post once I load on more cameras onto Asus RT-AC68R router to see how the load is. If it becomes unstable, I do have another Asus router, RT-AC56U to split the load.

Edit update: I have loaded a total of 8 Amcrest 1080p cameras have them all connected to Asus RT-56U and of course, I have oversaturated the 2.4 GHz Wi-Fi band as expected. What's unexpected is that by doing so, it'll cause the cameras to randomly reboot throughout the day and also not allow full recording of the videos captured. Therefore, at best, 4 cameras per 2.4 GHz band and lowering the recorded video bitrate (from VBR 6 best x264H 8192 Kbps to 2048 Kbps) would allow all 4 to work. Lowering the bitrate for all 8 would sacrifice video quality that isn't worth it. Besides, good thing is that I'll be running ethernet cables to at least 4 or 5 cameras and the remaining cameras to be on the 2.4 GHz band.

Edit update 2: Asus has disabled telnet option, therefore one would need to download and use PuTTY to log in through SSH. After logging in, the remaining 3 commands will apply the same.

Before throwing money at a NAS from QNAP or Synology - contact their pre-sales teams and explain the requirements and equipment, and they can get you sorted.

Syno and QNAP also have community forums that you can reach out to.

@sfx2000 , thanks for taking the time to recommend me what to do. However, I have decided to use what I have and not spend any more money than necessary.
 
Last edited:
I am using Asus RT-AC87U -Merlin.

I am using AiCloud and just hit an issue where I can only add 5 users so total 6 users including admin.

I need to raise this amount please if anyone can help.
 

Attachments

  • maximum 6 samba users.JPG
    maximum 6 samba users.JPG
    34.7 KB · Views: 173
This increases the number of concurrent connections. However, I am wanting to increase the number to user accounts. I need about 15 users added to the router. As I will implement the folder access. I cannot give out a generic user accounts. As I like to view the log as well.

I did test command this definitely only increased the concurrent users.
nvram set st_max_user=15

Is there a similar command to increase the user accounts?

thank
 
Is there a way of accessing the web page and then loading it back into the router? what is directory and name?

This is the only thing holding me back from using this as solution.
 
Yes you could write a script that mounted a modified copy of that web page at boot up. I've just tried it and it appears to work, although there might be unforeseen effects on other parts of the router's operations.

The web page in question is /www/Advanced_AiDisk_samba.asp

The Addons API does something similar.

Example services-start script:
Code:
#!/bin/sh

# Increase Samba table
cp /www/Advanced_AiDisk_samba.asp /tmp/
sed -i "s/accounts_length >= 6/accounts_length >= 15/" /tmp/Advanced_AiDisk_samba.asp
mount -o bind /tmp/Advanced_AiDisk_samba.asp /www/Advanced_AiDisk_samba.asp

# Increase FTP table
cp /www/Advanced_AiDisk_ftp.asp /tmp/
sed -i "s/accounts_length >= 6/accounts_length >= 15/" /tmp/Advanced_AiDisk_ftp.asp
mount -o bind /tmp/Advanced_AiDisk_ftp.asp /www/Advanced_AiDisk_ftp.asp
N.B. I have not been able to test this script on Merlin's firmware as I use John's which has a slightly different web page.
 
Last edited:
Hi Colin,

I have enabled
Enable JFFS custom scripts and configs

connected to the router using command prompt. connected ssh
excuted the command


but still nothing wasn't able to add any more users
 
I'm not sure what you mean by "executed the command". I gave you an example script, not a command.
 
sorry I meant I run the script through ssh as it was.

Am I meant put the script into a text file and place it somewhere?
 
I realised that the same change would also need to be applied to the FTP page as well as the Samba page, so I've updated the example in post #11.
 

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top