I want to generate a lot of requests using TSUNG.
My configuration file is
<?xml version="1.0"?>
<!DOCTYPE tsung SYSTEM "/usr/local/share/tsung/tsung-1.0.dtd">
<tsung loglevel="notice" dumptraffic="false" version="1.0">
<clients>
<client host="localhost" maxusers="70000" use_controller_vm="true"/>
</clients>
<servers>
<server host="myhost" port="5222" type="tcp"/>
</servers>
<load>
<arrivalphase phase="1" duration="70000" unit="second">
<users arrivalrate="10" unit="second"/>
</arrivalphase>
</load>
<options>
<option type="ts_jabber" name="global_number" value="70000"/>
<option type="ts_jabber" name="domain" value="my-domain"/>
<option name="file_server" id="userdb" value="/root/userdata.csv"/>
</options>
<sessions>
<session probability="100" name="xmpp-connection" type="ts_jabber" bidi="true" $
<setdynvars sourcetype="file" fileid="userdb" delimiter=";" order="iter">
<var name="userid"/>
</setdynvars>
<transaction name="initial_stream">
<request subst="true">
<jabber type="connect" ack="local">
<xmpp_authenticate username="tsung%%_userid%%" passwd="tsung%%_userid%%"/>
</jabber>
</request>
</transaction>
<thinktime value="2"/>
<transaction name="authenticate">
<request> <jabber type="auth_sasl" ack="local"/> </request>
<request> <jabber type="connect" ack="local"/> </request>
<request> <jabber type="auth_sasl_bind" ack="local"/> </request>
<request> <jabber type="auth_sasl_session" ack="local"/> </request>
</transaction>
<transaction name="roster_get">
<request> <jabber type="iq:roster:get" ack="local"/> </request>
</transaction>
<request> <jabber type="presence:initial" ack="no_ack"/> </request>
<for from="1" to="28" incr="1" var="counter">
<request> <jabber type="raw" ack="no_ack" data="
"/></request>
<thinktime value="60" random="false"/>
</for>
<for from="1" to="30" incr="1" var="counter">
<request> <jabber type="raw" ack="no_ack" data="
"/></request>
<thinktime value="60" random="false"/>
</for>
<transaction name="close">
<request> <jabber type="close" ack="no_ack"/> </request>
</transaction>
</session>
</sessions>
</tsung>
As per the documentation of TSUNG, I can hit the server using multiple client ips (one machine)
http://tsung.erlang-projects.org/user_manual/conf-client-server.html
Several virtual IP can be used to simulate more machines. This is very useful when a load-balancer use the client’s IP to distribute the traffic among a cluster of servers.
<clients>
<client host="louxor" weight="1" maxusers="800">
<ip value="10.9.195.12"></ip>
<ip value="10.9.195.13"></ip>
</client>
<client host="memphis" weight="3" maxusers="600" cpu="2"/>
</clients>
I want to find out how many connections per one machine I can generate using TSUNG.
I have a 32 GB, 8 core machine.
This will depend on two factors:
The maximum number of simultaneously open Erlang ports.
The maximum amount of open file description in your operating system.
For information about the first one see open ports in the 10.2 System Limits section of the Advanced Erlang document. It can be changed using the +Q option when starting the Erlang VM. The default is 16384. And the current limit can be checked using erlang:system_info/1:
erlang:system_info(port_limit).
For second information simply ulimit -n in the shell. How to change this value depends on the operating system but it's a popular topic so you will easily be able to search for instructions.
Related
I wanted to know if we can configure multiple base path for a proxy endpoint in APIGEE. The target proxy remains same for both basepaths.
Example: I want to ensure /hello/world and /hello/universe route to same target endpoint and are treated in same way entirely
<HTTPProxyConnection>
<BasePath>world</BasePath>
<BasePath>universe</BasePath>
<VirtualHost>hello</VirtualHost>
</HTTPProxyConnection>
How to achieve the same?
The <VirtualHost> field should refer to an Apigee vhost, which is a Fully Qualified Domain Name ('FQDN'). That's a hostname like demo.api.company.com. E.g., everything before the first /.
Your proxy basepath is then /hello, like this:
<BasePath>hello</BasePath>
And then the rest of your API proxy definition uses flows and path-matching conditions to handle the different methods you want to operate at /hello/world vs /hello/universe
<Flow name="world_GET">
<Description>World GET</Description>
<Request>
<Step>
<Name>World01</Name>
</Step>
<Step>
<Name>World02</Name>
</Step>
</Request>
<Response/>
<Condition>((proxy.pathsuffix MatchesPath "/world") and (request.verb = "GET"))</Condition>
</Flow>
<Flow name="universe_GET">
<Description>Uni GET</Description>
<Request>
<Step>
<Name>Uni01</Name>
</Step>
<Step>
<Name>Uni02</Name>
</Step>
</Request>
<Response/>
<Condition>((proxy.pathsuffix MatchesPath "/universe") and (request.verb = "GET"))</Condition>
</Flow>
See:
https://docs.apigee.com/api-platform/reference/api-proxy-configuration-reference#proxyendpoint-proxyendpointconfigurationelements
I have a single instance deployment of WSO2 and now I want to be able to access the carbon management services like publisher/store etc through http. I have tried the following configurations in catalina-server.xml. I also want to use nginx as reverse proxy through http port for carbon consoles. Please help. I have also tried editing the axis2.xml to add port mappings for nginx 80 and 443 port. Currently when i run carbon console through 9763 it gets redirected to 9443 and after adding mappings in axis2.xml it responds as requested url not found for /publisher/..../login.jag
<Server port="8005" shutdown="SHUTDOWN">
<Service className="org.wso2.carbon.tomcat.ext.service.ExtendedStandardService" name="Catalina">
<!--
optional attributes:
proxyPort="80"
-->
<Connector protocol="org.apache.coyote.http11.Http11NioProtocol"
port="9763"
bindOnInit="false"
maxHttpHeaderSize="8192"
acceptorThreadCount="2"
maxThreads="250"
minSpareThreads="50"
disableUploadTimeout="false"
connectionUploadTimeout="120000"
maxKeepAliveRequests="200"
acceptCount="200"
server="WSO2 Carbon Server"
compression="on"
compressionMinSize="2048"
noCompressionUserAgents="gozilla, traviata"
compressableMimeType="text/html,text/javascript,application/x-javascript,application/javascript,application/xml,text/css,application/xslt+xml,text/xsl,image/gif,image/jpg,image/jpeg"
URIEncoding="UTF-8"/>
<!--
optional attributes:
proxyPort="443"
Added sslEnabledProtocols="TLSv1,TLSv1.1,TLSv1.2" for poodle vulnerability fix
-->
<Connector protocol="org.apache.coyote.http11.Http11NioProtocol"
port="9443"
bindOnInit="false"
sslProtocol="TLS"
sslEnabledProtocols="TLSv1,TLSv1.1,TLSv1.2"
maxHttpHeaderSize="8192"
acceptorThreadCount="2"
maxThreads="250"
minSpareThreads="50"
disableUploadTimeout="false"
enableLookups="false"
connectionUploadTimeout="120000"
maxKeepAliveRequests="200"
acceptCount="200"
server="WSO2 Carbon Server"
clientAuth="false"
compression="on"
scheme="https"
secure="true"
SSLEnabled="true"
compressionMinSize="2048"
noCompressionUserAgents="gozilla, traviata"
compressableMimeType="text/html,text/javascript,application/x-javascript,application/javascript,application/xml,text/css,application/xslt+xml,text/xsl,image/gif,image/jpg,image/jpeg"
keystoreFile="${carbon.home}/repository/resources/security/wso2carbon.jks"
keystorePass="wso2carbon"
URIEncoding="UTF-8"/>
<Engine name="Catalina" defaultHost="localhost">
<!--Realm className="org.apache.catalina.realm.MemoryRealm" pathname="${carbon.home}/repository/conf/tomcat/tomcat-users.xml"/-->
<Realm className="org.wso2.carbon.tomcat.ext.realms.CarbonTomcatRealm"/>
<Host name="localhost" unpackWARs="true" deployOnStartup="false" autoDeploy="false"
appBase="${carbon.home}/repository/deployment/server/webapps/">
<Valve className="org.wso2.carbon.tomcat.ext.valves.CarbonContextCreatorValve"/>
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="${carbon.home}/repository/logs"
prefix="http_access_" suffix=".log"
pattern="combined"/>
<Valve className="org.wso2.carbon.tomcat.ext.valves.CarbonStuckThreadDetectionValve" threshold="600"/>
<Valve className="org.wso2.carbon.tomcat.ext.valves.CompositeValve"/>
</Host>
</Engine>
</Service>
Uncomment the following line in carbon.xml.
<EnableHTTPAdminConsole>true</EnableHTTPAdminConsole>
Please note this is not recommended in production environments.
I'm china developer, i use tsung to test my application.
but now , i have problem,
this is my xml code.
<options>
<option name="file_server" id="usernames" value="/usr/local/tsung/username.csv" />
</options>
<sessions>
<session name='rec20160406-1853' probability='100' type='ts_http'>
<setdynvars sourcetype="file" fileid="usernames" delimiter=";">
<var name="user_name"/>
</setdynvars>
<request subst="true">
<http url='http://10.2.0.96:3000/sessions?username=%%_user_name%%'>
</http>
</request>
</session>
</sessions>
username.csv
四方茉莉-Ra
宁靜致遠
阿莫西林
脸骑士
大嗨朵
右眼淤青
程子
这明显不科学
冰与火奏鸣曲
I want send user_name to my application, the user_name is read from csv file, the csv file is chinese content.
I start tsung, and watch the nginx access-log.
log:
192.168.60.61 - - [21/Apr/2016:17:17:29 +0800] "GET /sessions?username=\xE5\x86\xB0\xE4\xB8\x8E\xE7\x81\xAB\xE5\xA5\x8F\xE9\xB8\xA3\xE6\x9B\xB2 HTTP/1.1" 500 70 "-" "tsung"
the user_name encode to be \xE5\x86\xB0\xE4\xB8\x8E\xE7\x81\xAB\xE5\xA5\x8F\xE9\xB8\xA3\xE6\x9B\xB2, my application can not resolve this.
please help me , how can i to do.
I had gone through multiple articles and SO Questions like - this, this, and this (and many others)
However none of them serves my issue. I would like to deploy two web roles in one cloud service. I tried deploying the same but found one is running whereas other web role throws – Internet Explorer cannot display the webpage / connection timeout in firefox.
Here is what I tried so far: -
I have two web roles (App and Service), when I deployed either App or Service to a cloudservice for e.g. http://xxxx.cloudapp.net, it works fine.
But when I tried deploying both App on port 8080 & Service on port 80 in http://xxxx.cloudapp.net, and tried browsing - http://xxxx.cloudapp.net, it displays Service page.
Whereas, while browsing App using - http://xxxx.cloudapp.net:8080, it throws error – Internet Explorer cannot display the webpage / connection timeout in firefox.
But my app works fine when just App is deployed on port 80.
Here is the ServiceDefinition file : -
<ServiceDefinition name="AppServiceAzure" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2013-03.2.0">
<WebRole name="MyService" vmsize="Small">
<Sites>
<Site name="Web">
<Bindings>
<Binding name="Endpoint1" endpointName="Endpoint1" />
</Bindings>
</Site>
</Sites>
<Endpoints>
<InputEndpoint name="Endpoint1" protocol="http" port="80" />
</Endpoints>
<Imports>
<Import moduleName="Diagnostics" />
</Imports>
<Certificates>
<Certificate name="mycert" storeLocation="LocalMachine" storeName="My" />
</Certificates>
</WebRole>
<WebRole name="MyApp" vmsize="Small">
<Sites>
<Site name="Web">
<Bindings>
<Binding name="Endpoint1" endpointName="Endpoint1" />
</Bindings>
</Site>
</Sites>
<Endpoints>
<InputEndpoint name="Endpoint1" protocol="http" port="8080" />
</Endpoints>
<Imports>
<Import moduleName="Diagnostics" />
</Imports>
<Certificates>
<Certificate name="mycert" storeLocation="LocalMachine" storeName="My" />
</Certificates>
</WebRole>
</ServiceDefinition>
What I am missing here?
Each Windows Azure Compute instance represents a virtual server of either of following role.
Windows Azure Compute instance
|
|_______[front-end] web server (Web role)
|
|
|_____Site1
|
|
|_____Site2
|
|
|_____Site3 etc.
or
|
|
|
|_______back-end/.NET] application server (Worker role)
or
|
|
|
|_______VM
I suggest two approaches:
1) create Multiple sites in one role.(you will get different endpoints)
2) Or deploy one webrole to staging and other role to production. (again you will get different endpoints)
Here is my tsung.xml:
<?xml version="1.0"?>
<!DOCTYPE tsung SYSTEM "/usr/local/share/tsung/tsung-1.0.dtd">
<tsung loglevel="warning" version="1.0">
<clients>
<client host="localhost" use_controller_vm="true" maxusers="30000"/>
</clients>
<servers>
<server host="127.0.0.1" port="9988" type="tcp"/>
</servers>
<!--
<monitoring>
<monitor host="localhost" type="erlang"></monitor>
</monitoring>
-->
<load duration="90" unit="second">
<arrivalphase phase="1" duration="1" unit="minute">
<users arrivalrate="300" unit="second" />
</arrivalphase>
</load>
<options>
<option name="thinktime" value="0" random="false" override="true"/>
<option name="tcp_snd_buffer" value="4096"/>
<option name="tcp_rcv_buffer" value="4096"/>
<option name="ports_range" min="1025" max="65535"/>
</options>
<sessions>
<session name="mysocket" probability="100" type="ts_raw">
<request>
<raw datasize="1" ack="local"></raw>
</request>
</session>
</sessions>
</tsung>
It tests my socket program, but I cannot fully understand the Tsung report.
Please help to look at this pic, what does "simultaneous" mean?
If anyone can help to tell me something about the report stats, that will be fine.
Stats like following(fetched from Tsung's manual):
users: Number of simultaneous users.
connected: Number of simultaneous connected users. new in 1.2.2.
Is it good or bad if users and connected is low?
Thank you in advance.
The http server will close the TCP socket if there is no action on it for a while or if it is overloaded. The opening and closing of TCP Sockets is handled automatically by Tsung. That said the 'connected' value is the current number 'users' that are connected to the server. Hope this helps