EPrints Technical Mailing List Archive
Message: #09264
< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First
Re: [EP-tech] Error calling df: Cannot allocate memory
- To: <eprints-tech@ecs.soton.ac.uk>, "Agung Prasetyo W." <prazetyo@gmail.com>
- Subject: Re: [EP-tech] Error calling df: Cannot allocate memory
- From: David R Newman <drn@ecs.soton.ac.uk>
- Date: Wed, 5 Apr 2023 08:28:18 +0100
Hi,
df if in the Unix disk free command. Normally, if you ran it from the command line you would get an output like:
Filesystem 1K-blocks Used Available Use% Mounted on
devtmpfs 1010704 0 1010704 0% /dev
tmpfs 1021040 4 1021036 1% /dev/shm
tmpfs 1021040 98984 922056 10% /run
tmpfs 1021040 0 1021040 0% /sys/fs/cgroup
/dev/vda1 51474044 20500988 28335284 42% /
tmpfs 204208 0 204208 0% /run/user/1000
For EPrints this is run with certain extra options by EPrints::System's free_space function. Ultimately, in your case I think this is likely called by the function that is trying to work out which diskN directory to use under your archive's document directory (i.e. EPRINTS_PATH/archives/ARCHIVE_ID/documents/diskN/.).
However, here the error message refers to memory not disk space suggesting there is not enough memory on your server to run this command. df requires very little memory to run as far as I am aware. I would try running command "top" from your server's command and look for two lines like this:
KiB Mem : 2042080 total, 237740 free, 469956 used, 1334384 buff/cache
KiB Swap: 4194300 total, 3987964 free, 206336 used. 1291216 avail Mem
If on the top line the free number is very small and the ratio of used to buff/cache is very heavily waited towards used, then you may not have enough RAM to run your EPrints repository reliably. (Also, if on the second line the used Swap is very high, this is also a sign of a lack of usable memory) So if possible, it is worth adding some more RAM. Often a temporary fix for this is to restart your webserver (Apache). As it can sit on a lot of memory making it unusable.
Looking at the previous thread that refers to this they were only using 1GB of RAM. I would say that for all but the smallest EPrints repositories with very low visitor traffic, 1GB is not going to be enough RAM. I always use at least 2GB RAM, which is a big difference, as quite a bit of that first 1GB of RAM will be used just to run the Linux system. How much RAM are you using? How large is your archive (i.e. number of eprints according to /cgi/counter)? How much traffic do you get (e.g. how big (in megabytes) / many lines are in your last complete Apache access log)?
My best guess at why df is likely to show up in error messages like that shown below is that it is one of the most common commands called by EPrints, as it is important it knows how much space you have left in your documents directory. Also, it if probably one of the few commands that regularly calls out to a system command directly as result of a web browser request. Therefore, it is the error message you are likely to see but there will likely be other error messages suggesting a lack of memory issue but unless you look at the log files on the server or run various command from the command line you will not notice this lack of memory issue. However, another side effect I would expect is for your repository to be very slow to respond to requests.
If you can answer the questions I have and maybe provide the same two lines from the "top" command, like what I included above, this may help me determine whether this is just a lack of memory issue or whether there is some other underlying problem.
Regards
David Newman
On 05/04/2023 5:13 am, Agung Prasetyo
W. via Eprints-tech wrote:
CAUTION: This e-mail originated outside the University of Southampton.Hi,
Is there any solution for this?
EPrints System Error
Error calling df: Cannot allocate memory
I also found this thread at https://www.eprints.org/eptech/msg08276.html, but still no solution.
Thank you.Regards,
*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech *** Archive: http://www.eprints.org/tech.php/ *** EPrints community wiki: http://wiki.eprints.org/
- References:
- [EP-tech] Error calling df: Cannot allocate memory
- From: "Agung Prasetyo W." <prazetyo@gmail.com>
- [EP-tech] Error calling df: Cannot allocate memory
- Prev by Date: [EP-tech] Error calling df: Cannot allocate memory
- Next by Date: [EP-tech] {Suspected SPAM} Re: Error calling df: Cannot allocate memory
- Previous by thread: [EP-tech] Sort view with creators_name and corp_creators
- Index(es):