How to increase NCache memory allocation - memory

From what I know the memory allocation is set when the cache is created:
createcache demoCache /s 127.0.0.1 /S 1024
Do you know if the memory allocation for NCache can be increased without reinstalling the cache? I need to increase the NCache memory size on production and reinstalling the cache is the last scenario I can do.
Thank you !

I found a sollution:
cache needs to be stopped: stopCache demoCache /s 127.0.0.1
open the config file for the server with as admin: C:\Program Files\NCache\config\config.ncconf
update the memory allocation according to your needs, cache-config node:
type="heap" cache-size="2048mb"
start the cache back.

Related

azk - How to increase a VM memory in azk?

I am trying to increase the memory of VM into AZK. Is there some enviroment variable for do that? Can someone help me please?
azk (http://azk.io/)
The amount of memory must be set before starting azk agent. So, be sure the agent is down and run:
export AZK_VM_MEMORY=[memory size in MB]
azk agent start
As a shorthand, you can put the export command into your .profile, .bashrc or .zshrc file (depending on the shell you are using) to make that config persistent between different terminal sessions.
Note: by default, azk uses 1/6 of the total memory (or 512MB, whichever is greater) for the VM

Compiling Phalcon - Virtual memory exhausted: Cannot allocate memory

When I try to compile Phalcon, I get an error:
virtual memory exhausted: Cannot allocate memory
I am running the following commands
git clone --depth=1 git://github.com/phalcon/cphalcon.git
cd cphalcon/build
sudo ./install
I have a VPS with 1GB RAM
Add more swapfile may help. I met this problem when tried to compile YouCompleteMe for vim, solved it by adding swapfile.
https://www.digitalocean.com/community/articles/how-to-add-swap-on-ubuntu-14-04
It seems GCC is allocating a lot of memory, check this
https://web.archive.org/web/20141202015428/http://hostingfu.com/article/compiling-with-gcc-on-low-memory-vps
Stopping as many services as possible (Apache, MySQL etc.) will free up more memory, and Phalcon will compile. Worst case scenario you will need to increase the memory of your virtual box.
Thanks to #AndrewD for providing the link that works.
Another option that Andres suggested is to build from a different folder:
https://forum.phalconphp.com/discussion/7891/upgrading-from-201-to-205-getting-virtual-memory-exhausted-canno
The steps would be...
git clone --depth=1 git://github.com/phalcon/cphalcon.git
cd cphalcon/ext
sudo ./install
As he explained it, this approach uses less memory but takes more time and for newer version of GCC >4.7 the end result is the same.

Rake assets:precompile gets killed when there is a console session open in production

On my production server, which is hosted on digital ocean, if that helps, Ubuntu 12.04, I have RoR 4 and rake 10.1.1.
When I deploy, I run rake assets:precompile, and I've noticed a strange issue where if I have a rails console session open when I do this, I get the following output
~# rake assets:precompile
~# Killed
It's mainly annoying, but the reason I want it resolved is when hiring new developers, there will be deploy/console conflict nightmare.
Thanks,
Brian
Your precompile process is probably being killed because you are running out of RAM. You can confirm this by running top in another ssh session. To fix this, create a swap file that will be used when RAM is full.
Create SWAP Space on Ubuntu
You will probably end up needing some swap space if you plan on using Rails on Digital Ocean 512MB RAM droplet. Specifically, you will run out of RAM when compiling the assets resulting in the process being quietly killed and preventing successful deployments.
To see if you have a swap files:
sudo swapon -s
No swap file shown? Check how much disk space space you have:
df
To create a swap file:
Step 1: Allocate a file for swap
sudo fallocate -l 2048m /mnt/swap_file.swap
Step 2: Change permission
sudo chmod 600 /mnt/swap_file.swap
Step 3: Format the file for swapping device
sudo mkswap /mnt/swap_file.swap
Step 4: Enable the swap
sudo swapon /mnt/swap_file.swap
Step 5: Make sure the swap is mounted when you Reboot. First, open fstab
sudo nano /etc/fstab
Finally, add entry in fstab (only if it wasn't automatically added)
# /etc/fstab
/mnt/swap_file.swap none swap sw 0 0
Save and exit. You're done adding swap. Now your rake assets:precompile should complete without being killed.
Rake assets:precompile is a memory eating process.
So make sure you have enough RAM before using that command
I have an opsworks stack on aws and I'd to change my instance type.
I was using t1.micro and i just changed it to t1.small
Thanks a lot.
This uses a lot of RAM. To check how much available RAM memory you have free, use the command
free -m
This will show the available RAM in MB
A temporary solution would be to create a swap space.
I was going to add this as a comment to Jason R post above before you go into his steps, just to make sure it is a RAM resource issue.
you could also run
echo {1,2,3} > /proc/sys/vm/drop_caches
to clean up the cache memory, but it probably will not free up enough.
This might help someone. For me, since i couldn't use 'fallocate' command, i had to do:
sudo dd if=/dev/zero of=/mnt/4GB.swap bs=4096 count=1048576
sudo chmod 600 /mnt/4GBB.swap
sudo mkswap /mnt/4GB.swap
sudo swapon /mnt/4GB.swap

Where is my /etc/sysctl.conf file? Postgresql Fatal could not create shared memory segment

My goal is to install and fully setup Postgresql by following railscast video.
P.S I am on a Mountain Lion 10.8
$ brew install postgresql
seems okay.
$ initdb /usr/local/var/postgres
ok's ok's then...
FATAL: could not create shared memory segment: Cannot allocate memory
DETAIL: Failed system call was shmget(key=1, size=2072576, 03600).
HINT: This error usually means that PostgreSQL's request for a shared memory segment exceeded available memory or swap space, or exceeded your kernel's SHMALL parameter. You can either reduce the request size or reconfigure the kernel with larger SHMALL. To reduce the request size (currently 2072576 bytes), reduce PostgreSQL's shared memory usage, perhaps by reducing shared_buffers or max_connections.
So like a good young SO grasshopper I start googling. and come to This SO post:
PostgreSQL installation error -- Cannot allocate memory
the suggested answer in this post lead me to this answer:http://willbryant.net/software/mac_os_x/postgres_initdb_fatal_shared_memory_error_on_leopard
$ sudo sysctl -w kern.sysv.shmall=65536
Password:
kern.sysv.shmall: 1024 -> 65536
$ sudo sysctl -w kern.sysv.shmmax=16777216
kern.sysv.shmmax: 4194304 -> 16777216
looks like everything worked so far, but in order to protect my changes from reboot, I need to update my /etc/sysctl.conf file. The problem is that I can't find it!
how do I locate this file? From my peanut sized understanding of computers, there is no filepath that exists, and if it did what is before the /etc ?? it certainly is not on my desktop. all I get is no such file exists, but I don't know how to find this file.
Embarrassing. I was trying to CD into my file. just do $ cd /etc

How to solve error memory size of bytes exhausted

I am trying to install symfony on wamp
http://trac.symfony-project.org/wiki/HowToInstallSymfonyOnWindowsWithWamp
when executed second step : pear install symfony/symfony
i got an error show below , how to go round
Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 7680 bytes) in /home/www/sf_projects/homepage/lib/vendor/symfony/lib/widget /sfWidgetFormDate.class.php on line 39
Just increase the memory limit for your PHP Environment by setting proper value inside php.ini
Looks like you're having just 16MB assigned, try inreasing this value.. common setting is for CLI environment.
memory_limit = 128M
You'll find the php.ini somewhere in your WAMP folder, after adjusting the value you need to restart the apache server.

Resources