0

I have a small VPS with 64MB RAM. I use it as an internal proxy. I only have one index.php on this server, which has the logic to fetch data from another server using php curl and display to the client (this is done for every request - there are no local files whatsoever).

I have installed PHP APC so that the index.php lies in the RAM. Are there any disadvantages to having APC on a 64MB box? I have heard there can be fragmentation/swapping problems - but I assume not in my case, right? On a related note: Does CURL cache any data (enough to create problem with APC on a 64 MB RAM?).

Any tips on best practices on this box to prevent swapping/fragmentation would be very helpful (I am pretty much a noob with this).

thanks

JP

  • Where sells 64MB VPS's - cruelhosts.com or something? how much more would it be to push the boat out and double your memory? – Chopper3 Dec 02 '10 at 11:57
  • :) there are some low end providers. Actually I have few of them, and dont want to push till really needed. –  Dec 02 '10 at 14:16

2 Answers2

0

The only way to be sure is to run some tests for yourself, as I assume that none of the relevant project teams have particularly tested their code in such a constrained environment so you won't find any "official" recommendations.

Replicate the small VM on a local system, put it under some test load, and see what happens.

Regarding Curl, IIRC it performs no caching in memory: content it recieves is dropped to disk immediately and it does not stay resident after a transfer is completed. The kernel may cache some of the content being written of course.

David Spillett
  • 22,534
  • 42
  • 66
0

You won't have fragmentation problems, since the only file you have is the index.php. APC is an opcode cache, not a caching proxy, so only one php file's code section (opcode) will sit there, nothing else from an external source. So no fragmentation will occur and of course none of your curl data will be "cached".

Jauzsika
  • 623
  • 1
  • 4
  • 10