Back

Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in AWS by (19.1k points)

I've got myself an Amazon ec2 Micro Instance (A VPN Server) to play around with.

The problem is that Amazon charges you for every disc IO you do in a Micro Instance.

The instance is running Amazon Linux a flavour of CentOS.

I've started a Scala application in Play 2.0(.2) framework on the server and I'm the only one who connects to the application.

I have observed that every few second something on the server commits IO transactions, to narrow it down I installed a Linux program called iotop.

Here is output after a couple of seconds.

TID  PRIO USER     DISK READ DISK WRITE  SWAPIN IO>    

23333 be/4 root        0.00 B/s 11.91 K/s 0.00 %  0.00 %  

COMMAND java -Dsbt.ivy.home=/usr/play-2.0.2/framework/../repository -Djava.runtime.name=OpenJDK ~/jars/slf4j-api.jar:/usr/play-2.0.2/repository/local/org.slf4j/jul-to-slf4j/1.6.4/jars/j

A cat from the log file

cat /home/ec2-user/socketTest/logs/application.log

2012-07-05 11:43:31,881 - [INFO] - from play in main

Listening for HTTP on port 9000...

So Play doesn't write anything to the log file.

The first question have I understood the iotop correct and that Play indeed is the disc IO thief.

If so why do play use IO?

My application is a simple WebSocket example. In essence it echos the input to the output. The IO occurs even thou nothing is pushed thru WebSockets.

1 Answer

0 votes
by (12.4k points)

Providing the sample code,

$ inotifywait -r -m /opt /etc /var -e ATTRIB -e CREATE -e MODIFY -e DELETE

Setting up watches.  Beware: since -r was given, this may take a while!

Watches established.

/var/tmp/ CREATE etilqs_uOXWfa8v7DkNBgd

/var/tmp/ DELETE etilqs_uOXWfa8v7DkNBgd

/var/tmp/ MODIFY etilqs_uOXWfa8v7DkNBgd

/var/tmp/ MODIFY etilqs_uOXWfa8v7DkNBgd

/var/tmp/ MODIFY etilqs_uOXWfa8v7DkNBgd

  ...

Here replace "opt/etc/var" with your own directory.

Once you know which files are being written you are good to go to stop it.

Want to learn more about AWS? Come & join: AWS Online training

Related questions

0 votes
1 answer

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers

500 comments

94k users

Browse Categories

...