Memory usage errors and problem sending forms from wifi connections

Hi,

I have a local installation of ODK Aggregate on an Ubuntu machine. I have installed Tomcat-8 server along with Mysql-5.7. All tools are of the latest versions.

A. I have added the following lines to Tomcat systemd service file located at /etc/systemd/system/tomcat.service:

Environment='CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC'
Environment='JAVA_OPTS=-Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom'

B. In Mysql server memory has been modified by adding the following lines to the file /etc/mysql/my.cnf:

[mysqld]
character_set_server=utf8
collation_server=utf8_unicode_ci
max_allowed_packet=1073741824

[mysqldump]
max_allowed_packet=1073741824

C. Even on the NGINX server ihave increase the memdory by adding the following lines to /etc/nginx/nginx.conf

http {
client_max_body_size 1073741824;

Despite all these efforts when I upload an audio or video file of size >10 MB Iget the error "File too large (max 10Mb).

When I upload forms from a desktop with LAN/Ethernet connection containing images/videos of big sizes 1 to 7 Mb, it goes through. But the same process with laptop or cellphone having wifi connection does not go through. Forms containing only text data have no issues. The same problem is observed when using both Enketo or ODK Collect.

Any help on this matter is highly appreciated. Please point to me specific log files that I need to look into.

Many thanks for all your help.

With best regards,
Ganesh

Hi Ganesh! Your post is a little confusing because you don't explain what role nginx plays in your setup. Maybe it's a proxy?

My recommendation is to look at the logs for Tomcat, MySQL and nginx and see if there are hints there about what is failing. Then trace how your HTTP posts flow through the system and make sure you allow posts that are larger than 10 MB at every step.

As a quick guess, it might be the case that your Tomcat config (server.xml) needs to have maxPostSize configured.

As another quick guess, you might also be running out of RAM. 1GB of RAM for a Tomcat server isn't a lot.

Hi Ganesh,

would you please give us more information about your physical memory,

in fact take care when using:
'CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC’

because it may lead to shutdown your server.

i don't recommend to use 1GB if your RAM less than 4GB
Tomcat poll memory
JVM memory
MYSQL memory
OS memory
etc..

also, as an advice always do a backup for you configuration before editing it.