Measuring inflow and outflow traffic with Jetty based app - jetty

My server application is using embedded jetty as an http end point. It hosts several web applications with a bunch of jsp/servlets as well as several web services.
This application will eventually be deployed on the cloud but before that I'd like to make sure that this app measures the inflow and outflow (in bytes) coming through the jetty. I could probably make a global filter and count bytes somehow..
But is there a more intelligent way of doing this?

You should check for NetworkTrafficListener in Jetty 7 & 8, and how to use it in this test class.

Related

Application using Invantive Web Service extremely slow at PCs with Webroot SecureAnywhere

Several PCs with Windows 7 and .NET 4.5.2 are using an application based upon the Invantive Web Service to access data located after the Web Service server. However, since a few months the performance is bad.
Even switching between tabs in the user interface is slow, taking multiple seconds instead of instaneous switching.
The problem was caused by Webroot SecureAnywhere, an anti-virus product. Invantive Web Service uses HTTPS to communicate between application and the web service servers.
Webroot SecureAnywhere does some form of deep packet inspection on HTTPS connections. The application in this case typically exchanges information in average every few seconds using a HTTPS POST with a small payload (several hundred bytes).
Webroot SecureAnywhere inspects this HTTPS POST and it takes approximately 750-1700 ms per HTTPS POST to analyze it and pass it through. Measured on an i3 processor with Windows 7.
When Webroot SecureAnywhere was disabled, response times per HTTPS POST dropped from in average 1.500 ms to 30 ms.
Long term solution is to either abandon use of Webroot SecureAnywhere or that Webroot SecureAnywhere improves their algorithm in how they do deep packet inspection on HTTPS POSTs.
Short term solution is to add entries for all approved remote sites using HTTPS to the white list of Webroot SecureAnywhere.

Load testing enterprise server with webservices

I want to load test an enterprise server which is running 80 different SOAP webservices. All webservices need to be used at the same time. I want to register breaking point of the overall system.
I found some tools for testing a single webservice but not for all at the same time. Which tools can i use?
Our tool http://www.stresstimulus.com can test multiple Web services at the same time. For each web service, create a separate test case http://support.stresstimulus.com/display/doc40/Creating+Multiple+Test+Cases
To do so, issue a SOAP request and record it with StresStimulus proxy, or import a Fiddler .saz capture file.
By default, all test cases will have the same mix weight = 1, so load will be spread between them evenly. To customize the load distribution, adjust the mix weights. After that, you can ramp-up the load to reach a breaking point. You'll receive a separate performance report for each web service as well as consolidated report with response times, errors and other KPI.

Should I use MSMQ or IIS

I have a web site that exposes a web service to all my desktop clients.
Randomly, these clients will invoke the web service which in turn will add a message jpeg in byte array format to the MSMQ.
I have a service application that reads from this queue and performs an enhancement on this jpeg and saves it to the hard drive.
The number of clients uploading at anyone time is unpredictable.
I choose this method because I do not want to put any strain on IIS. The enhancements my service application performs is not much 'erg' but it exists nevertheless.
However, after realizing that my service application had stopped for sometime and required restarting I noticed the RAM leap up to clear the backlog. Whilst I have corrected this and the service is now coded to restart automatically on fail I surmised that a backlog could exists at busy times which again give a higher RAM usage.
Now, should I accept to do the processing all within my web service and then save to the hard drive or am I correct in using a MSMQ?
I am using C# and asp.net

Why do common web services client use a proxy

I've noticed that most architectures that acts as a web service client uses a proxy to communicate with the rest server? While it is possible to access a rest service without a proxy server, one example I've read is this where it uses a proxy server to communicate with its rest server are there any advantages of using a proxy to access a rest service?
Using a proxy is usually not necessary for small local application web services. It depends mostly on your server load (number of clients, frequency of requests), and on the network area where your services are accessed : back-office server-to-server, front-office LAN, WAN or on the whole internet).
The REST webservices are mostly online resources, identified in a unique way by an URL, and generally served in a classic HTTP way. From the client side, he does not know if the data he gets is static, dynamic or cached. He simply gets the data as if it's static.
On large scale applications, with the increase of clients, resources and web services requests, you need technical components to handle problematics like user balancing, usage tracking of your web services as your application evolves. You'll also want to deliver the best performance you can to the clients. This can be achieved efficiently with a proxy solution.
Advantages of NOT using a proxy:
Simplicity
Advantages of using a proxy-based solution:
Rewrite URLs from a single centralized entry point (instead of setting it heterogeneously on each server/app/ws configuration).
Track the usage of your webservices (globally)
Enhance performance capabilities (caching, balancing to dedicated servers)
Managing API versions (switching gobally /myAPI from /myAPI-V1 to /myAPI-V2 easily done, and go back fingers in the nose)
Modifying some API calls on-the-fly (compatibility between versions, do preliminary input data validation, or add technical information to calls).
Manage webservices security globally (control IPs, quota per user, etc).
Hope this answers your question.
Edit (in answer to comment)
The proxy can act as a cache. For frequently asked resources (REST services), it can serve the same response to several users. Your service will be called juste once, even if there is 100 requests on this resource.
But this depend on how your services are really used, so you need to track requests to know if caching is helpful or not in your case.
How many users do you have ?
How many web services ?
Whar kind of data/resources are served ?
How fast are your services (individually) ?
What is the network performance ? (LAN? WAN? Internet? Mobile?)
How many servers and applications serve your users ?
Do you encounter any network load problems ?
A proxy cannot "accelerate" your existing services, but it can enhance the way you serve the resources to your clients.
Do not use a proxy if you do not know if you need it. You must know what is your actual system architecture and what are the weaknesses and bottlenecks.

How to limit simultaneous request from a single client?

We provide couple of SOAP web service.
Yesterday our service was down, we couldn't access to the service from the outside (can't even load the wsdl), but we could access to the service if we were connected with terminal service on the server.
The thing is one of our partner was calling our web service with 130 simultaneous threads.
So I think the service was down because this partner was occupying all the available connection. And this limitation is done by .net because I can easily read static file (txt) on my server from the outside, and the service accept the connection if it's from the local IP.
Here is my question : how can I limit the simultaneous connection count for one client ? I know I can do it for every one in IIS Manager, I can do it for outgoing request (connectionmanagement configuration). But I can't find it for incoming request.
It's strange because I think it's one of the first thing I'd set to prevent DOS attack.
(.net 3.5 , IIS 6)