Every night we are truncating most of the tables in the DB and inserting data from remote databases.
The total size of data that we are inserting every night is about 300 GB.
The problem is that DB size is much bigger:
SELECT pg_size_pretty( pg_database_size('comb') );
pg_size_pretty
----------------
943 GB
(1 row)
Also, there are a lot of old files (from 2020 for example) in data/base directory that not appears in pg_class:
cd data/base
ll 935829*
-rw------- 1 postgres postgres 1073741824 Sep 4 2020 935829
-rw------- 1 postgres postgres 1073741824 Sep 4 2020 935829.1
-rw------- 1 postgres postgres 1073741824 Sep 4 2020 935829.2
-rw------- 1 postgres postgres 1073741824 Sep 4 2020 935829.3
-rw------- 1 postgres postgres 1073741824 Sep 4 2020 935829.4
-rw------- 1 postgres postgres 1073741824 Sep 4 2020 935829.5
-rw------- 1 postgres postgres 1073741824 Sep 4 2020 935829.6
-rw------- 1 postgres postgres 1073741824 Sep 4 2020 935829.7
-rw------- 1 postgres postgres 1073741824 Sep 4 2020 935829.8
-rw------- 1 postgres postgres 1073741824 Sep 4 2020 935829.9
-rw------- 1 postgres postgres 1073741824 Sep 4 2020 935829.10
-rw------- 1 postgres postgres 1073741824 Sep 4 2020 935829.11
-rw------- 1 postgres postgres 1073741824 Sep 4 2020 935829.12
-rw------- 1 postgres postgres 1073741824 Sep 4 2020 935829.13
-rw------- 1 postgres postgres 1073741824 Sep 4 2020 935829.14
-rw------- 1 postgres postgres 1073741824 Sep 4 2020 935829.15
-rw------- 1 postgres postgres 1073741824 Sep 4 2020 935829.16
-rw------- 1 postgres postgres 1073741824 Sep 4 2020 935829.17
-rw------- 1 postgres postgres 1073741824 Sep 4 2020 935829.18
-rw------- 1 postgres postgres 1073741824 Sep 4 2020 935829.19
-rw------- 1 postgres postgres 1073741824 Sep 4 2020 935829.20
-rw------- 1 postgres postgres 1073741824 Sep 4 2020 935829.21
-rw------- 1 postgres postgres 1073741824 Sep 4 2020 935829.22
-rw------- 1 postgres postgres 1073741824 Sep 4 2020 935829.23
-rw------- 1 postgres postgres 1073741824 Sep 4 2020 935829.24
-rw------- 1 postgres postgres 1073741824 Sep 4 2020 935829.25
-rw------- 1 postgres postgres 1073741824 Sep 4 2020 935829.26
-rw------- 1 postgres postgres 1073741824 Sep 4 2020 935829.27
-rw------- 1 postgres postgres 1073741824 Sep 4 2020 935829.28
-rw------- 1 postgres postgres 1073741824 Sep 4 2020 935829.29
-rw------- 1 postgres postgres 1073741824 Sep 4 2020 935829.30
-rw------- 1 postgres postgres 1073741824 Sep 4 2020 935829.31
-rw------- 1 postgres postgres 1073741824 Sep 4 2020 935829.32
-rw------- 1 postgres postgres 1073741824 Sep 4 2020 935829.33
-rw------- 1 postgres postgres 1073741824 Sep 4 2020 935829.34
-rw------- 1 postgres postgres 1073741824 Sep 4 2020 935829.35
-rw------- 1 postgres postgres 1073741824 Sep 4 2020 935829.36
-rw------- 1 postgres postgres 1073741824 Sep 4 2020 935829.37
-rw------- 1 postgres postgres 1073741824 Sep 4 2020 935829.38
-rw------- 1 postgres postgres 1073741824 Sep 4 2020 935829.39
SELECT relname, relnamespace::regnamespace, relkind FROM pg_class WHERE relfilenode = 935829;
relname | relnamespace | relkind
---------+--------------+---------
(0 rows)
Time: 8.156 ms
We tried to execute VACUUM FULL to release unused space to OS.
It finished successfuly, but no space was freed to OS.
Last time this happend we performed logical backup (pg_dump) and restore to shrink this DB.
This time we would like to undestand the reason of this issue.
Please advise.
First, find out is the files belong to an existing relation (assuming that the relation is in the default tablespace):
SELECT pg_filenode_relation(0, 935829);
If the result is NULL, and the files are old, you can delete them.
They must have been left behind after a crash.
Related
I am trying to create react app and i have a nodejs (express) backend
here is a link to the repo
as you can see in the repo the file client is empty
and I can't add (stage) the client file
when I do git add. then git status
I get the following message
On branch master
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
(commit or discard the untracked or modified content in
submodules)
modified: client (modified content, untracked content)
modified: package.json
no changes added to commit (use "git add" and/or "git commit -a")
I tried git add . , git add client
but nothing works i can't push the client file to github
ls -all returns this :
total 55
drwxr-xr-x 1 user 197121 0 Jun 20 16:38 ./
drwxr-xr-x 1 user 197121 0 Jun 20 15:11 ../
drwxr-xr-x 1 user 197121 0 Jun 21 10:24 .git/
-rw-r--r-- 1 user 197121 15 Jun 20 15:18 .gitignore
drwxr-xr-x 1 user 197121 0 Jun 20 15:57 client/
drwxr-xr-x 1 user 197121 0 Jun 20 15:14 node_modules/
-rw-r--r-- 1 user 197121 362 Jun 20 17:14 package.json
-rw-r--r-- 1 user 197121 14290 Jun 20 15:14 package-lock.json
-rw-r--r-- 1 user 197121 389 Jun 20 15:17 server.js
Try execute
git rm -rf --cached client
and
git add client
in the client directory.
I'm using a mongo database link to a AngularJS/NodeJS website on an Amazon server with ubuntu 14.04.
Since 1 month, every 5 or 6 day my data are unreachable I can't connect to the website with mail/password. I need to shutdown the database and relaunch it to make it works. And all the data stored are lost.
I don't understand why and the logfile looks normal.
Here it's the full log when the bug appears
Thu Aug 17 00:38:52.947 [initandlisten] MongoDB starting : pid=1714 port=27017 dbpath=/home/ubuntu/data/db 64-bit host=ip-myIp
Thu Aug 17 00:38:52.947 [initandlisten] db version v2.4.9
Thu Aug 17 00:38:52.947 [initandlisten] git version: nogitversion
Thu Aug 17 00:38:52.947 [initandlisten] build info: Linux orlo 3.2.0-58-generic #88-Ubuntu SMP Tue Dec 3 17:37:58 UTC 2013 x86_64 BOOST_LIB_VERSION=1_54
Thu Aug 17 00:38:52.947 [initandlisten] allocator: tcmalloc
Thu Aug 17 00:38:52.947 [initandlisten] options: { dbpath: "/home/ubuntu/data/db", fork: true, logpath: "/var/log/mongod.log" }
Thu Aug 17 00:38:52.952 [initandlisten] journal dir=/home/ubuntu/data/db/journal
Thu Aug 17 00:38:52.952 [initandlisten] recover : no journal files present, no recovery needed
Thu Aug 17 00:38:52.978 [initandlisten] waiting for connections on port 27017
Thu Aug 17 00:38:52.978 [websvr] admin web console waiting for connections on port 28017
Thu Aug 17 00:40:23.927 [initandlisten] connection accepted from 127.0.0.1:52328 #1 (1 connection now open)
Thu Aug 17 00:42:43.295 [conn1] end connection 127.0.0.1:52328 (0 connections now open)
Thu Aug 17 00:43:17.159 [initandlisten] connection accepted from 127.0.0.1:52329 #2 (1 connection now open)
Thu Aug 17 00:47:13.931 [initandlisten] connection accepted from 127.0.0.1:52330 #3 (2 connections now open)
Thu Aug 17 02:53:56.046 [initandlisten] connection accepted from 62.210.127.77:35059 #4 (3 connections now open)
Thu Aug 17 02:53:57.064 [conn4] end connection 62.210.127.77:35059 (2 connections now open)
Thu Aug 17 02:53:57.096 [initandlisten] connection accepted from 62.210.127.17:51812 #5 (3 connections now open)
Thu Aug 17 02:53:57.125 [initandlisten] connection accepted from 62.210.127.17:51816 #6 (4 connections now open)
Thu Aug 17 02:53:57.532 [conn5] end connection 62.210.127.17:51812 (3 connections now open)
Thu Aug 17 02:53:57.532 [conn6] end connection 62.210.127.17:51816 (2 connections now open)
Thu Aug 17 03:23:44.832 [initandlisten] connection accepted from 74.82.47.5:35734 #7 (3 connections now open)
Thu Aug 17 03:23:44.976 [conn7] end connection 74.82.47.5:35734 (2 connections now open)
Thu Aug 17 03:23:57.019 [initandlisten] connection accepted from 74.82.47.5:41550 #8 (3 connections now open)
Thu Aug 17 03:23:57.172 [conn8] end connection 74.82.47.5:41550 (2 connections now open)
Thu Aug 17 05:45:19.925 [initandlisten] connection accepted from 220.181.159.73:40602 #9 (3 connections now open)
Thu Aug 17 05:45:22.925 [conn9] end connection 220.181.159.73:40602 (2 connections now open)
Thu Aug 17 05:45:23.168 [initandlisten] connection accepted from 220.181.159.73:49766 #10 (3 connections now open)
Thu Aug 17 05:45:25.929 [conn10] end connection 220.181.159.73:49766 (2 connections now open)
Thu Aug 17 05:45:26.159 [initandlisten] connection accepted from 220.181.159.73:58268 #11 (3 connections now open)
Thu Aug 17 05:45:26.159 [conn11] end connection 220.181.159.73:58268 (2 connections now open)
Fri Aug 18 03:01:37.788 [initandlisten] connection accepted from 184.105.247.196:61094 #12 (3 connections now open)
Fri Aug 18 03:01:37.931 [conn12] end connection 184.105.247.196:61094 (2 connections now open)
Fri Aug 18 03:01:51.123 [initandlisten] connection accepted from 184.105.247.196:3532 #13 (3 connections now open)
Fri Aug 18 03:01:51.267 [conn13] end connection 184.105.247.196:3532 (2 connections now open)
Sat Aug 19 00:21:23.527 [initandlisten] connection accepted from 45.55.29.41:43416 #14 (3 connections now open)
Sat Aug 19 00:21:33.361 [conn14] end connection 45.55.29.41:43416 (2 connections now open)
Sat Aug 19 03:17:28.802 [initandlisten] connection accepted from 184.105.247.195:42566 #15 (3 connections now open)
Sat Aug 19 03:17:29.028 [conn15] end connection 184.105.247.195:42566 (2 connections now open)
Sat Aug 19 03:17:41.312 [initandlisten] connection accepted from 184.105.247.195:61782 #16 (3 connections now open)
Sat Aug 19 03:17:41.456 [conn16] end connection 184.105.247.195:61782 (2 connections now open)
Sat Aug 19 11:24:28.098 [initandlisten] connection accepted from 168.1.128.35:10000 #17 (3 connections now open)
Sat Aug 19 11:24:31.686 [conn17] end connection 168.1.128.35:10000 (2 connections now open)
Sun Aug 20 03:17:03.998 [initandlisten] connection accepted from 184.105.247.252:57362 #18 (3 connections now open)
Sun Aug 20 03:17:04.298 [conn18] end connection 184.105.247.252:57362 (2 connections now open)
Sun Aug 20 03:17:16.801 [initandlisten] connection accepted from 184.105.247.252:11208 #19 (3 connections now open)
Sun Aug 20 03:17:16.945 [conn19] end connection 184.105.247.252:11208 (2 connections now open)
Sun Aug 20 19:07:53.815 [initandlisten] connection accepted from 106.2.120.103:49396 #20 (3 connections now open)
Sun Aug 20 19:08:03.825 [conn20] end connection 106.2.120.103:49396 (2 connections now open)
Sun Aug 20 23:08:15.624 [initandlisten] connection accepted from 106.2.120.103:48933 #21 (3 connections now open)
Sun Aug 20 23:08:16.383 [conn21] end connection 106.2.120.103:48933 (2 connections now open)
Mon Aug 21 12:38:02.076 [initandlisten] connection accepted from 207.226.141.36:41710 #22 (3 connections now open)
Mon Aug 21 12:38:03.379 [conn22] end connection 207.226.141.36:41710 (2 connections now open)
Mon Aug 21 12:38:03.706 [initandlisten] connection accepted from 207.226.141.36:42522 #23 (3 connections now open)
Mon Aug 21 12:38:04.499 [conn23] dropDatabase BACKUP_DB starting
Mon Aug 21 12:38:04.500 [conn23] removeJournalFiles
Mon Aug 21 12:38:04.507 [conn23] dropDatabase BACKUP_DB finished
Mon Aug 21 12:38:05.037 [conn23] end connection 207.226.141.36:42522 (2 connections now open)
Mon Aug 21 12:38:05.361 [initandlisten] connection accepted from 207.226.141.36:43398 #24 (3 connections now open)
Mon Aug 21 12:38:06.166 [conn24] dropDatabase morethanwinebo starting
Mon Aug 21 12:38:06.166 [conn24] removeJournalFiles
Mon Aug 21 12:38:06.170 [conn24] dropDatabase morethanwinebo finished
Mon Aug 21 12:38:06.708 [conn24] end connection 207.226.141.36:43398 (2 connections now open)
Mon Aug 21 12:38:07.042 [initandlisten] connection accepted from 207.226.141.36:44336 #25 (3 connections now open)
Mon Aug 21 12:38:08.154 [FileAllocator] allocating new datafile /home/ubuntu/data/db/Warning.ns, filling with zeroes...
Mon Aug 21 12:38:08.154 [FileAllocator] creating directory /home/ubuntu/data/db/_tmp
Mon Aug 21 12:38:08.158 [FileAllocator] done allocating datafile /home/ubuntu/data/db/Warning.ns, size: 16MB, took 0.001 secs
Mon Aug 21 12:38:08.158 [FileAllocator] allocating new datafile /home/ubuntu/data/db/Warning.0, filling with zeroes...
Mon Aug 21 12:38:08.161 [FileAllocator] done allocating datafile /home/ubuntu/data/db/Warning.0, size: 64MB, took 0.002 secs
Mon Aug 21 12:38:08.161 [FileAllocator] allocating new datafile /home/ubuntu/data/db/Warning.1, filling with zeroes...
Mon Aug 21 12:38:08.163 [FileAllocator] done allocating datafile /home/ubuntu/data/db/Warning.1, size: 128MB, took 0.001 secs
Mon Aug 21 12:38:08.165 [conn25] build index Warning.Readme { _id: 1 }
Mon Aug 21 12:38:08.166 [conn25] build index done. scanned 0 total records. 0.001 secs
Mon Aug 21 12:38:08.724 [conn25] end connection 207.226.141.36:44336 (2 connections now open)
Mon Aug 21 12:53:15.501 [FileAllocator] allocating new datafile /home/ubuntu/data/db/morethanwinebo.ns, filling with zeroes...
Mon Aug 21 12:53:15.503 [FileAllocator] done allocating datafile /home/ubuntu/data/db/morethanwinebo.ns, size: 16MB, took 0.001 secs
Mon Aug 21 12:53:15.503 [FileAllocator] allocating new datafile /home/ubuntu/data/db/morethanwinebo.0, filling with zeroes...
Mon Aug 21 12:53:15.505 [FileAllocator] done allocating datafile /home/ubuntu/data/db/morethanwinebo.0, size: 64MB, took 0.001 secs
Mon Aug 21 12:53:15.508 [conn3] build index morethanwinebo.sessions { _id: 1 }
Mon Aug 21 12:53:15.508 [conn3] build index done. scanned 0 total records. 0 secs
Mon Aug 21 12:53:15.508 [FileAllocator] allocating new datafile /home/ubuntu/data/db/morethanwinebo.1, filling with zeroes...
Mon Aug 21 12:53:15.510 [FileAllocator] done allocating datafile /home/ubuntu/data/db/morethanwinebo.1, size: 128MB, took 0.001 secs
Tue Aug 22 03:05:13.792 [initandlisten] connection accepted from 74.82.47.2:27720 #26 (3 connections now open)
Tue Aug 22 03:05:14.026 [conn26] end connection 74.82.47.2:27720 (2 connections now open)
Tue Aug 22 03:05:27.955 [initandlisten] connection accepted from 74.82.47.2:52792 #27 (3 connections now open)
Tue Aug 22 03:05:28.099 [conn27] end connection 74.82.47.2:52792 (2 connections now open)
When I'm launching the database I use this command
sudo mongod --fork --logpath /var/log/mongod.log --dbpath /home/ubuntu/data/db
Is it because I'm using sudo for launching the database ? Maybe mongo need some permission in read/write for doing some things and he can't so the bug appears ?
My first thought was because the server was too small so I increase it from 8Go to 16Go but this change nothing and the bug appears yesterday
Have a look at the activity of IP address 207.226.141.36 on Monday August21. You have had an unsolicited visitor:
https://www.abuseipdb.com/check/207.226.141.36
I have written an application in CakePHP 3.2 and recently uploaded to a dedicated server.
But this is giving RuntimeException error as
Cache engine Cake\Cache\Engine\FileEngine is not properly configured.
Warning: file_put_contents(/var/www/html/logs/error.log)
[function.file-put-contents]: failed to open stream: Permission denied in
/var/www/html/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php on line 134
I tried with changing permission of logs and tmp directory to 777 (including sub directories) but this doesn't solve the issue.
output of ls -la
drwxr-xr-x. 13 root root 4096 Oct 22 02:39 .
drwxr-xr-x. 4 root root 43 Oct 12 20:12 ..
drwxr-xr-x. 2 root root 63 Oct 21 15:08 bin
-rw----r--. 1 root root 1499 Oct 21 15:08 composer.json
-rw----r--. 1 root root 48701 Oct 21 15:08 composer.lock
drwxr-xr-x. 3 root root 4096 Oct 21 15:08 config
-rw----r--. 1 root root 329 Oct 21 15:08 .editorconfig
-rw----r--. 1 root root 772 Oct 21 15:08 .gitattributes
-rw----r--. 1 root root 41 Oct 21 15:08 .gitignore
-rw----r--. 1 root root 159 Oct 22 03:02 .htaccess
-rw----r--. 1 root root 648 Oct 21 15:08 index.php
-rw-r--r--. 1 apache apache 20 Oct 13 00:10 info.php
drwxrwxrwx. 2 root root 46 Oct 22 02:30 logs
drwxr-xr-x. 2 root root 10 Oct 21 15:08 mobile_scripts
-rw----r--. 1 root root 1202 Oct 21 15:08 phpunit.xml.dist
drwxr-xr-x. 3 root root 37 Oct 21 15:08 plugins
-rw----r--. 1 root root 1015 Oct 21 15:08 README.md
drwxr-xr-x. 8 root root 4096 Oct 21 15:13 src
drwxr-xr-x. 4 root root 71 Oct 21 15:13 tests
drwxrwxrwx. 6 root root 76 Oct 21 15:13 tmp
-rw----r--. 1 root root 321 Oct 21 15:08 .travis.yml
drwxr-xr-x. 21 root root 4096 Oct 21 15:14 vendor
drwxr-xr-x. 5 root root 4096 Oct 21 15:24 webroot
What could be the cause and how to resolve it ?
I had the same problem.
It can be due to the permission of logs and tmp directories.
But sometimes, if your web server user is different from your command line user, you can have this permission error !
You can run this little command in the project's directory :
HTTPDUSER=`ps aux | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1`
setfacl -R -m u:${HTTPDUSER}:rwx tmp
setfacl -R -d -m u:${HTTPDUSER}:rwx tmp
setfacl -R -m u:${HTTPDUSER}:rwx logs
setfacl -R -d -m u:${HTTPDUSER}:rwx logs
It will setup permission properly !!
Don't forget to restart apache services :
service apache2 restart
If you want to check this : https://book.cakephp.org/3.0/en/installation.html
I hope it will be helpfull !! :D
I got it working. For someone if get stuck with this error can try this solution.
I am using centOS Server
disabling SELinux worked for me.
I had the same issue and it looks like it had to do with apache not having the right permissions on the project files.
I managed to solve it by recursively setting the owner and the group of the whole project directory to the web server user by:
HTTPDUSER=`ps aux | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1`
sudo cd "your project directory"
sudo chown $HTTPDUSER:$HTTPDUSER -R .
Hope that helps!
Anuj's answer about disabling SELinux worked for me as well. I was delighted to find this after hours of trying other things. I just wanted to add that I didn't disable it, but rather changed it to 'permissive' from 'enforcing.' I am running CakePHP 2.4.2 on CentOS 7 on an AWS T2 instance.
I'm trying to setup an old version of Solr for one of our drupal developers. Apparently only versions 1.x or 3.x will work with the current version of drupal.
I'm setting up solr 3.4.2 under tomcat.
I have solr living in /opt:
# ls -ld /opt/solr
lrwxrwxrwx. 1 root root 17 May 6 12:48 /opt/solr -> apache-solr-3.6.2
And I have my cores located here:
# ls -ld /opt/solr/admin/cores
drwxr-xr-x. 3 root root 4096 May 6 14:37 /opt/solr/admin/cores
Just one core so far, until I can get this working.
# ls -l /opt/solr/admin/cores/
total 4
drwxr-xr-x. 5 root root 4096 May 6 14:08 collection1
I have this as my solr.xml file:
<solr persistent="false"
<cores adminPath="/admin/cores" defaultCoreName="collection1">
<core name="collection1" instanceDir="collection1" />
</cores>
</solr>
Which is located in these two places:
# ls -l /opt/solr/solr.xml /usr/local/tomcat/conf/Catalina/solr.xml
-rw-r--r--. 1 root root 169 May 6 14:38 /opt/solr/solr.xml
-rw-r--r--. 1 root root 169 May 6 14:38 /usr/local/tomcat/conf/Catalina/solr.xml
These are the contents of my /opt/solr directory
# ls -l /opt/solr/
total 436
drwxr-xr-x. 3 root root 4096 May 6 14:37 admin
-rw-r--r--. 1 root root 176647 Dec 18 2012 CHANGES.txt
drwxr-xr-x. 3 root root 4096 May 6 12:48 client
drwxr-xr-x. 9 root root 4096 Dec 18 2012 contrib
drwxr-xr-x. 3 root root 4096 May 6 12:48 dist
drwxr-xr-x. 3 root root 4096 May 6 12:48 docs
-rw-r--r--. 1 root root 1274 May 6 13:28 elevate.xml
drwxr-xr-x. 11 root root 4096 May 6 12:48 example
-rw-r--r--. 1 root root 81331 Dec 18 2012 LICENSE.txt
-rw-r--r--. 1 root root 20828 Dec 18 2012 NOTICE.txt
-rw-r--r--. 1 root root 5270 Dec 18 2012 README.txt
-rw-r--r--. 1 root root 55644 May 6 13:27 schema.xml
-rw-r--r--. 1 root root 60884 May 6 13:27 solrconfig.xml
-rw-r--r--. 1 root root 169 May 6 14:38 solr.xml
Yet, when I bounce tomcat, this is the result that I get:
HTTP Status 404 - missing core name in path
type Status report
message missing core name in path
description The requested resource is not available.
Cany anyone tell me what I'm doing wrong?
Thanks!!
it seems that your search server uses a multi core setup.
In that case you need your core name as part of the URL.
e.g. instead of requesting
http://localhost:8983/solr/select/?q=text
you have to request
http://localhost:8983/solr/yourCoreName/select/?q=text
please check whether solr home is defined in your WEB-INF/web.xml.
Check out this similar question for some similar and different solutions.
HTTP ERROR: 404 missing core name in path with solr
Getting "missing core name in path" when trying to access Solr admin installed on Glassfish
We have developed one project on cakephp for a govt. entity. After development the server provider for this govt. entity told us that they won't be providing 777 file permission on the server as this is against their guidelines. Now we need a solution to run this with 775 file permission. Any way out for this ?
This is what they told us
"Write and Read Permission can be given to only one folder i.e WriteReadData. No customized folder is allowed. Yes you can create as many folder under WriteReadData folder. And in Web Server environment only 775 permission."
Please suggest how to run this application.
I don't see a real problem in there ?
Just check your tmp folder, here is a link for more infos -> here
777 permissions are not required
Or a good idea.
The problem is really ownership, not permissions. An app should always run on the principle of least privilege, i.e. the minimum permissions to permit it to function. Applied to the tmp folder (which is the only folder that needs to be writable) that could simply mean:
[ app ]
-> chown -R www-data:www-data tmp
[ app ]
-> chmod -R 700 tmp
[ app ]
-> ls -la
total 44
dr-xr-xr-x 11 root root 4096 May 20 14:46 .
dr-xr-xr-x 6 root root 4096 Jun 11 15:28 ..
dr-xr-xr-x 2 root root 4096 Jun 13 07:34 Config
dr-xr-xr-x 3 root root 4096 May 22 14:10 Console
dr-xr-xr-x 3 root root 4096 May 22 14:10 Controller
dr-xr-xr-x 14 root root 4096 May 6 09:42 Locale
dr-xr-xr-x 3 root root 4096 May 15 09:21 Model
dr-xr-xr-x 3 root root 4096 Feb 25 10:40 Plugin
drwx------ 5 www-data www-data 4096 Apr 23 14:33 tmp
dr-xr-xr-x 10 root root 4096 Feb 25 10:40 View
dr-xr-xr-x 7 root root 4096 Jun 11 15:28 webroot
Where www-data is the webserver user.