How to configure a server with 4g of memory to run drupal 7
If you already have Drupal7 Data, you should load it into a staging environment and perform some buffer sizing based on the amount of data you have.

Step 1) You must first compute the buffer sizes for your dataset.

Step 2) If the recommended sizes exceed 75% of your installed RAM (in you case 3GB) then cap the needed buffers at 3GB. 

Step 3) If you have InnoDB data and you did not enable innodb_file_per_table, you need to cleanup InnoDB by segmenting each table into its own physical tablespace (this only needs to be done once).

Once you have done this, you should plan to perform this configuration audit (Steps 1 and 2) every 6 months to make sure you have the proper MySQL caching in place.

Interestingly, I addressed a question similar to this and answered it on April 15th, 2011.