Performance Debugging with my application on Nanos #2042
Replies: 4 comments 10 replies
-
That definitely sounds problematic. ftrace might come in handy here, https://nanovms.com/dev/tutorials/profiling-and-tracing-nanos-unikernel but to start with - how are you comparing these instances? Are they in the cloud? local? Are they both using kvm and are bridged? Can you describe your setup? Do you have a smaller bit of sample code that is reproducible that you can share? |
Beta Was this translation helpful? Give feedback.
-
I am comparing the application performance by running it in a Firecracker microVM using a Debian 12 OS image, as well as running it with OPS, both in qemu and within Firecracker. Both setups showed higher latency compared to running the application directly on the Debian image. All testing is being conducted on my local machine, which is running Ubuntu 20.04.6 (Focal Fossa). Unfortunately, I do not have a sample code snippet available to reproduce the error. I've created a package under ops/packages/ that includes the application binary and its necessary files(html,css..etc). To execute the application, I use the following command:
Could you provide steps on how to enable Ftrace for further investigation? |
Beta Was this translation helpful? Give feedback.
-
besides the linked article there is also this, https://github.com/nanovms/nanos/tree/master/tools/trace-utilities , you could also use something like perf, https://nanovms.com/dev/tutorials/measuring-unikernel-cold-boot-time-with-perf but i kinda feel like they would both be overkill for what you're seeing I don't know how helpful these tools are going to be for you here - if you're saying a request is taking 1-2 seconds when it should be taking 100-200ms i'd start by timestamping the beginning and end of that request in your request handler and use that as your starting point and then putting in more timestamps halfway, then halfway between that, etc. in between to drill down where it exactly you're seeing an issue this doesn't sound like it's something nanos related, although it most certainly could be; but it's really hard to know what you're running into without some kind of reproducible code that shows it i'm not even sure what language you're using here but you could make a simple webserver in that language that either shows this behavior and we can go from there or it doesn't show that behavior and that gives you a clue that there's something inside that request handler that is causing issues; or you could even put a new simple hello route in that app and see if it does the same thing or not |
Beta Was this translation helpful? Give feedback.
-
I’m looking to enable ftrace in the ops image. The command I’ve come across is:
I've gone through the ftrace tutorial however, I'm unclear on what the TARGET parameter specifically refers to in this context. Additionally, I need some steps to compile Nanos with my application(consisting of multiple folders/files) and enable ftrace. |
Beta Was this translation helpful? Give feedback.
-
I've been testing a server application on both Linux and the Nanos Unikernel. The application binary starts a server and handles requests. On Linux, the total response time for a request is consistently around 100-150ms. However, when running the same application on Nanos, the response time increases significantly to around 1.6-2 seconds.
To investigate this issue, I enabled tracing and ran the application using the following command:
The trace logs, however, did not provide clear insights into the cause of the latency. Here is a snippet from the logs:
The logs mainly indicate threads being woken up and blocked on futexes, but they do not pinpoint the source of the latency.
How can I effectively debug the increased response time when running on Nanos Unikernel? Are there specific tools or methods that can help identify the root cause of this slowness?
Any insights or suggestions would be greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions