1

I don't know how to phrase this question properly so please feel free to suggest edits.

I've helped develop an in-house RESTful service for a company I'm working for, and it seems to have hit a wall in terms of performance without saturating the network channel (I think). I need to make it run faster, but I don't have enough data to go on. How do I measure, collect and analyze performance metrics like network, disk, memory and CPU usage? Right now I only have timestamped logs so I could try and extract some timing data by parsing them, but it seems like there should be a more straightforward way. Also should I make the system distributed in the future, I'd have to aggregate this data somehow across multiple machines, and I'd have to make this process asynchronous and resistant to network glitches.

What existing tools or general approaches work best in this kind of setup? I'd appreciate any nudge in the right direction, I don't know where to look.

UPD: I'm targeting FreeBSD, my dev box is a MacBook; the heavy lifting parts are written in C++, the talk-to-client parts are written in PHP (currently Yii) run by Apache with an nginx proxy, although I'm considering porting them to C++ and splitting them into multiple parts along the separation of commands and queries line of thought. Currently the command queue is managed by PostgreSQL, and it's one of the things I'm itching to rewrite from scratch. There is a simplistic supervisor that allows me to see the stderr log of the heavy lifting daemon in real time, but otherwise it doesn't do much.

3
  • You should state which O/S and framework the webservices are running as this information might have an impact on your answer (e.g. performancecounters codeproject.com/Articles/8590/… in Windows and .Net) Commented Sep 1, 2015 at 18:26
  • Just ask Yuki! (Sorry, couldn't resist given your profile pic) Most server OSes have monitoring tools built for them, but they differ a lot. There are also language-specific ways to do this. You'd have to be more specific about those things. Commented Sep 1, 2015 at 18:28
  • @Ordous I added some details Commented Sep 1, 2015 at 18:44

2 Answers 2

1

You can usually collect RAM / disk / CPU / network usage from SNMP data, just enable snmpd. Choose your monitoring solution; anything from something as small as Monit or Icinga to something large like OpenNMS will readily show you these.

Write more to logs, at least during the development and load testing; timestamps uncover a lot. But this may become slow if disk is your bottleneck.

You can collect more detailed data right in the program code and push it into an in-memory database like Redis, or a proper time-series database like OpenTSDB. This should be relatively easy to integrate into your C++ part, and have a reasonably small performance impact.

-1

I think that you need fisrt isolate your envrioment, and deploy your web service. After that divide your web service in modules to see which module is your bottleneck and fix them or review. I dont know frameworks to do that, but you can use command line linux tools into your isolated envrioment to do that.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.