title,body,link,tags,view_count,is_answered,score,answer_count
Stress Testing with Postman,"<p>I am building a website with rails on AWS and I am trying to determine the best ways to stress-test while also getting some idea of the cost I will be paying by user (very roughly). I have looked at tools like Selerium and I am curious if I could do something similar with Postman.</p>

<p>My objects are:</p>

<ol>
<li><p>Observe what kind of load the server would be under during the test, how the cpu and memory are affected.</p></li>
<li><p>See how the load generated would affect the cpu cycles on the system that would generate cost to me by AWS.</p></li>
</ol>

<p>Through Postman I can easily generate REST calls to my rails server and simulate user interaction, If I created some kind of multithreaded application that would make many calls like to the server, would that be an efficient way to measure these objectives?</p>

<p>If not, is there a tool that would help me either either (or both) of these objectives?</p>

<p>thanks,</p>
",https://stackoverflow.com/questions/45173553/stress-testing-with-postman,"['ruby-on-rails', 'performance', 'amazon-web-services', 'load']",3060,TRUE,0,1
Stress testing Apache using python,"<p>Everyone,</p>

<p>I'm trying to stress test my apache server and below is what I wrote for this purpose (Not sure if this would do what I want to do)</p>

<pre><code>import requests

url = ""http://&lt;ip of my server&gt;""
response = requests.get(url,verify=False, json={})
sum = 0

while sum != 1:
    print (response.status_code)
</code></pre>

<p>I believe that the above code sends continuous get requests to my apache web server, which could put some stress on my server.</p>

<p>Not sure if I'm making sense with this.</p>

<p>Any directions on how can I put some stress on my apache would be really helpful.</p>

<p>Thanks in advance.</p>
",https://stackoverflow.com/questions/46523312/stress-testing-apache-using-python,"['python', 'apache', 'python-3.x']",855,TRUE,1,1
"Performance, load and stress testing in Django","<p>I am studying the different types of testing for a Django application. I know how to do functional and unit testing in Django and how to apply different methodologies, but now I am facing a new challenge, I need to know how to do:</p>

<ul>
<li>Performance testing</li>
<li>Load testing</li>
<li>Stress testing</li>
</ul>

<p>I <strong>know the difference between them</strong> but I dont know which is the best methodology to follow,which are the best packages for do it or simply where I can get some <strong>documentation</strong> about it. </p>

<p>So my question is, how can I start to do these types of tests in a Django app or where can I get some good documentation about it?</p>

<p>Thanks </p>
",https://stackoverflow.com/questions/46893226/performance-load-and-stress-testing-in-django,"['python', 'django', 'testing', 'performance-testing']",12373,TRUE,16,1
Gatling stress testing for socket.io,"<p>I'm trying to test socket.io with gatling and i'm using exec block:</p>

<pre><code>//...
 .exec(session =&gt; {
 val socket = IO.socket(socketURL + session.get(""token"").as[String])
 val printListener: Emitter.Listener = new Emitter.Listener {
    override def call(args: AnyRef*): Unit = {
       println(args) //Stop time here for example
    }
 }
 socket.on(""info"", printListener)
 socket.connect()
 socket.emit(""info"", ""{}"") //Start timer
 session
 })
//...
</code></pre>

<p>Is any way to have time of execution of exec block in gatling report?</p>
",https://stackoverflow.com/questions/43660232/gatling-stress-testing-for-socket-io,"['scala', 'socket.io', 'gatling']",824,TRUE,1,1
Stress testing of ParseServer app,"<p>I have an app with ParseServer back-end and Ionic2 front-end. I need to simulate multiple users to stress test the back-end. </p>

<p>What load testing tools would you recommend to use for such setup?</p>

<p>Thanks. </p>
",https://stackoverflow.com/questions/42682868/stress-testing-of-parseserver-app,"['ionic2', 'load-testing', 'parse-server', 'stress-testing']",331,TRUE,0,3
Performance/Load/Stress Testing Orchestration layer,"<p>We have a spring based application which acts as an orchestration layer which consumes other Rest Apis. 
I want to performance test only this component and not the downstream apis being consumed. </p>

<p>I am looking for any architectural suggestions as to how this can be done?</p>

<p>The current approach (flawed) is,
I have created end points specifically for these tests which functionally put the main thread to sleep for a fixed time (short, medium and long delays) and return mock responses eventually. The reason i put the main thread to sleep is to mimic the I/O operation when making an external rest api call. </p>
",https://stackoverflow.com/questions/42016970/performance-load-stress-testing-orchestration-layer,"['java', 'spring', 'performance-testing']",139,TRUE,0,1
Stress Testing to Improve Run Time,"<p>I am taking an open course on Data Structures and Algorithms to get to know C++ a little better. </p>

<p>Basically the code takes the two highest inputs and then multiplies them together. The code that's provided takes a long time to run. They want us to use a stress test to locate and fix the bug in the program and I do not know where to start. </p>

<p>Here is the code that was provided:</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;vector&gt;
using namespace std;


int MaxPairwiseProduct(const vector&lt;int&gt;&amp; numbers) {
int result = 0;
double n = numbers.size();   
for (int i = 0; i &lt; n; ++i) {  
    for (int j = i + 1; j &lt; n; ++j) { 
        if (numbers[i] * numbers[j] &gt; result) { 
            result = numbers[i] * numbers[j];
        }
    }
}
return result;
}
int main() {
    int n;
    cin &gt;&gt; n;
    vector&lt;int&gt; numbers(n);
    for (int i = 0; i &lt; n; ++i) {
        cin &gt;&gt; numbers[i];
    }

    int result = MaxPairwiseProduct(numbers);
    cout &lt;&lt; result &lt;&lt; ""\n"";
    return 0;

}
</code></pre>
",https://stackoverflow.com/questions/41599100/stress-testing-to-improve-run-time,"['c++', 'time', 'stress-testing']",305,FALSE,0,0
Average Response time Increasing at Stress testing,"<p>I am using CodeIgniter for my API implementation. Please find the server resources and technologies used as follows :</p>

<p><strong>SUMMARY</strong></p>

<pre><code>Framework : CodeIgniter

Database : MySQL (Hosted on RDS) (1 MASTER &amp; 2 SLAVE)

Hosting :  AWS t2.Micro

Web Server  : Nginx
</code></pre>

<p>Following is the Report of the LOADER.IO report as per my test.</p>

<p>My API MIN RESPONSE TIME :  383 MS</p>

<p>NUMBER OF HITS : 10000 / 1 MIN CONCURRENT</p>

<p>As you can see in below image AVERAGE RESPONSE is 6436 MS . </p>

<p>I am expecting at least 100000 / 1 MIN users for watching an event on my application. </p>

<p>I would appreciate if anybody can help with some OPTIMIZATIONS Suggestions.</p>

<p><a href=""https://i.stack.imgur.com/DwvrL.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/DwvrL.png"" alt=""enter image description here""></a></p>

<p><strong>MAJOR THINGS I have done so far</strong></p>

<p>1) SWITCHED TO NGINX FROM APACHE</p>

<p>2) MASTER / SLAVE Configuration (1 MASTER , 2 SLAVE)</p>

<p>3) CHECKED each INDEX in USER JOURNEY in the application</p>

<p>4) CODE OPTIMIZATION :  AS you can see 383 MS is a good Response time of an API
5) USED EXPLAIN of MYSQL for checking the explaination of Queries</p>
",https://stackoverflow.com/questions/46808539/average-response-time-increasing-at-stress-testing,"['php', 'mysql', 'performance', 'codeigniter', 'amazon-rds']",295,TRUE,2,2
Python - stress testing - can&#39;t start new thread,"<p>Recently, company test the API that I developed. (Use Flask) <br/>
If a new user connect, I need to create a thread to process his request. <br/>
When it came to about 2000 users. It showed</p>

<pre><code>File ""C:\python27\Lib\threading.py"", line 494, in start
  _start_new_thread(self.__bootstrap, ())
error: can't start new thread
</code></pre>

<p>I've surveyed related question. But still don't know how to solve this problem. <br/>
Is there any parameter that I can increase the thread number ? <br/>
Or <br/>
How can I solve this problem?</p>

<p>I will thank you so so so much ~!!</p>
",https://stackoverflow.com/questions/44157068/python-stress-testing-cant-start-new-thread,"['python', 'multithreading', 'api', 'flask', 'stress-testing']",543,FALSE,1,0
Stress testing of flow (Rest) with JMeter,"<p>I have a rest service which receives a customer's ID and an input, acording to this the services response something different, it's basically a menu, but the reponse could be different (depends on the customers input), so I need to stress this service to see how many request the server can handle and try to determine the max TPS, but since is a flow I don't know how I can simulate this, any idea or page that can be useful?</p>

<p>Thanks in advance for your help</p>
",https://stackoverflow.com/questions/42638210/stress-testing-of-flow-rest-with-jmeter,"['rest', 'jmeter', 'jmeter-plugins', 'stress-testing']",47,FALSE,0,1
How to properly cleanup Cassandra after stress testing?,"<p>I've been tasked with standing up and prep'ing our production Cassandra cluster (3.11.1). Everything was fine, loaded in a few hundred million records with the stress testing tool, great. However after I was done I did a ""DROP KEYSPACE keyspace1;"" (the space used by the stress test) assuming this was like MySQL and the space would be cleaned up.</p>

<p>Now I've run nodetools cleanup, flush, truncatehints, cleansnapshots and just about every other command variation I can find. The disk usage is still ~30GB per node and nothing seems to be going on in Cassandra.</p>

<p>So #1 - How do I recover the diskspace that is being absorbed by the now deleted keyspace?</p>

<p>And #2 - How should I have deleted this data, if this was the ""wrong way""?</p>
",https://stackoverflow.com/questions/47644257/how-to-properly-cleanup-cassandra-after-stress-testing,"['cassandra', 'cassandra-3.0']",519,TRUE,1,2
Stress Testing needs to done on tableau portal,"<ol>
<li>Tableau version just got upgraded from 9 to 10 . There are 500 reports which i need to test in v10 . </li>
<li>My requirement is - if 50+ users access the same report at same time , is there any impact , basically stress testing . </li>
<li>For that , i need information regarding any ""open source tool or firefox plugin"" which can create a lot of dummy users and access the report at same time .</li>
<li>i read JMeter carries out the same , but i am looking for a tool/plugin which is easy to use and requires little or no programming. 
Kindly suggest how can i achieve it .</li>
</ol>
",https://stackoverflow.com/questions/41457044/stress-testing-needs-to-done-on-tableau-portal,"['jmeter', 'stress-testing']",797,FALSE,0,2
Java: How can i avoid ObjectOptimisticLockingFailureException while stress testing,"<p>i have a little wicket application where users can log in.
When they login a log is written in the database. Before persisting, the rows are counted and thats where the exception comes from when i run the stress test with 30 users logging in and out simultaneously.</p>

<p>This countig and persisting takes place in a Spring-DAO annotated with @Transactional also there is a connection pool. The counting method looks like this:</p>

<pre><code>private long getLogSize() {
    final CriteriaBuilder cb = getCriteriaBuilder();
    final CriteriaQuery&lt;Long&gt; cq = cb.createQuery(Long.class);
    final Root&lt;UserLog&gt; userLog = cq.from(UserLog.class);
    cq.select(cb.count(userLog ));
    return query.getSingleResult();
}
</code></pre>

<p>So how can i lock the table and prevent the race condition? Setting the query to setLockMode(LockModeType.PESSIMISTIC_READ) does not work, only i get this: MySQLTransactionRollbackException: Deadlock found when trying to get lock; try restarting transaction.</p>
",https://stackoverflow.com/questions/43661394/java-how-can-i-avoid-objectoptimisticlockingfailureexception-while-stress-testi,"['java', 'spring', 'jpa', 'locking']",409,FALSE,2,0
Spring Integration TCP connection refused under multithreaded load/stress testing,"<p>I have a Spring Integration project that handles TCP messages. </p>

<p>The simplest scenario is the PING message (receive msg from source and echo it back), the flow in the SI project is as follows :</p>

<p>1) Message is received from source (by a tcp-inbound-gateway). The source closes the socket after each message. </p>

<p>2) A transformer analyzes the message and sets (among others) a header value with the reply channel name</p>

<p>3) A Header-Value-Router is applied over the message that routes it back to the source.</p>

<p><strong>XML config (simplified version) is below :</strong> </p>

<pre><code>&lt;int-ip:tcp-connection-factory id=""TCP_SRV""
                               type=""server""
                               port=""${router.port}""
                               using-nio=""true""
                               single-use=""true""
                               serializer=""CustomSerializer""
                               deserializer=""CustomSerializer""/&gt;

&lt;int-ip:tcp-inbound-gateway request-channel=""rawInputFromSource""
                            reply-channel=""outputBackToSource""
                            connection-factory=""TCP_SRV""/&gt;

&lt;int:channel id=""rawInputFromSource""/&gt;

&lt;int:transformer ref=""inputFromSourceTransformer""
                 input-channel=""rawInputFromSource""
                 output-channel=""processedInputFromSource""/&gt;

&lt;int:channel id=""processedInputFromSource""/&gt;

&lt;bean id=""inputFromSourceTransformer"" class=""my.org.InputFromSourceTransformer""/&gt;

&lt;int:header-value-router input-channel=""processedInputFromSource"" 
                         header-name=""RouteToChannel""/&gt;
</code></pre>

<p>It works ok from a functional pov when invoking messages manually, but it fails under stress testing. Once I ramp up over 15 threads (each thread running a for loop sending 10 messages) I receive <strong>java.net.ConnectException: Connection refused: connect</strong> for about 20% of the attempts.</p>

<p><strong>The code snippets used by the threads to send the msg :</strong> </p>

<pre><code>byte[] sendAndReceive(byte[] data){
    byte[] result = new byte[data.length];
    try {
        Socket socket=new Socket(""localhost"", SI_PORT); // here is where the err occurs
        OutputStream output = socket.getOutputStream();
        InputStream  input = socket.getInputStream();
        output.write(data);
        input.read(result);
        socket.close();
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    return result;
}
</code></pre>

<p><strong>Error :</strong> </p>

<pre><code>java.net.ConnectException: Connection refused: connect
at java.net.TwoStacksPlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at java.net.Socket.connect(Socket.java:538)
at java.net.Socket.&lt;init&gt;(Socket.java:434)
at java.net.Socket.&lt;init&gt;(Socket.java:211)
at my.org.PerformanceTest.sendAndReceive(PerformanceTest.java:98)
</code></pre>

<p>The requirements say it must pass with 60 threads. Any ideas what I can do to solve this issue ? I tried adding a <strong>task:executor id=""threadPoolTaskExecutor"" pool-size=""5-10"" queue-capacity=""100"" rejection-policy=""CALLER_RUNS""</strong> on the factory but this didn't solved the issue.</p>

<p>Any advice is highly appreciated</p>
",https://stackoverflow.com/questions/46889958/spring-integration-tcp-connection-refused-under-multithreaded-load-stress-testin,"['java', 'multithreading', 'sockets', 'tcp', 'spring-integration']",886,TRUE,2,1
C# UWP stress testing: How to simulate a button press,"<p>When I repeatedly press a buttons in my UI, I see the memory usage increases without an apparent limit (starts at ~9MB and 2 minutes of pressing results in ~12MB).</p>

<p>I thought I had programmed things so that there were no loose ends within the button click event handler, so I'm very motivated to find out what happens after pressing this button many many times (stress test). I've tried two methods for automating the stress test:</p>

<p>Method 1 is that I run the code inside the event handler using a timer.</p>

<p>Method 2 looks like this:</p>

<pre><code>//I think following using statements give access to controls automation within UWP
using Windows.UI.Xaml.Automation.Peers;
using Windows.UI.Xaml.Automation.Provider;

public MainPage()
{
    //Everything else I'm doing to set up the main page goes here

    buttonTestTimer = new DispatcherTimer();
    buttonTestTimer.Tick += ButtonTestTimer_Tick;
    buttonTestTimer.Interval = new TimeSpan(0, 0, 0, 0, 200);
    buttonTestTimer.Start();
}

private void ButtonTestTimer_Tick(object sender, object e)
{
    var ap = new ButtonAutomationPeer(btn_Toggle);
    var ip = ap.GetPattern(PatternInterface.Invoke) as IInvokeProvider;
    ip?.Invoke();
}
</code></pre>

<p>Neither method results in > ~10MB memory usage, even though they are performing the events much faster than when I manually press the button over and over.</p>

<p>So they do not seem to be an accurate way to simulate the manual button pressing.</p>

<p>Am I wrong to want to stress test automatically? How can I do this?</p>
",https://stackoverflow.com/questions/47660542/c-uwp-stress-testing-how-to-simulate-a-button-press,"['c#', 'xaml', 'debugging', 'memory-management', 'uwp']",271,FALSE,0,0
How to do Stress Testing of transaction modules/payment modules,"<p>I am working on an Android App which deals with ""Secured Payment"" Using Debit/Credit Cards.How I could test the stress/capacity of the ""Payment Process"" where custom session Id is required for secure login, Card Info is required for Transaction ...</p>

<p>My Summarized query: How Companies like Payoneer do Stress Testing of their transaction modules? Which frameworks/tools/scripts they generally use?</p>
",https://stackoverflow.com/questions/45832564/how-to-do-stress-testing-of-transaction-modules-payment-modules,"['load', 'performance-testing', 'load-testing']",30,FALSE,0,1
Function has different behaviors in simultaneously calls under stress testing,"<p>I found a bug in a software that only happens under stress testing. A function is massive called and have different behaviors if the calls are simultaneously or almost simultaneously.</p>

<p>I made up an example to illustrate what is happening:</p>

<pre><code>public void doPayment(Acccount account) throws MyException {

    if (isMoneyAvailable(account)) {
        confirmPayment(account);
    }else{
        throw new MyException(myErrorCode);
    }
}
</code></pre>

<p>If this function is called twice simultaneously, two payments are done when the account has money just for one payment.</p>

<p>Do you have any ideas how I can prevent that kind of errors?</p>
",https://stackoverflow.com/questions/47153722/function-has-different-behaviors-in-simultaneously-calls-under-stress-testing,"['java', 'multithreading', 'load-testing', 'stress-testing']",75,TRUE,0,4
Web stress testing of AngularJS SPA ASP.NET MVC application in Visual Studio,"<p>Is it possible to test AngularJS SPA application developed using ASP.NET MVC with Visual Studio or any other alternative tool for the same purpose?</p>
",https://stackoverflow.com/questions/44154946/web-stress-testing-of-angularjs-spa-asp-net-mvc-application-in-visual-studio,"['angularjs', 'visual-studio', 'performance-testing']",811,TRUE,-2,2
Stress testing software (but I need run it step by step) with locust,"<p>as question in the Title <br>
what I meant step by step is like : <br>
-signup<br>
-get course<br>
-choose course<br>
all those three must be in order , step by step<br>
<br>
FYI
I already make it on on_start but the status result is never correct
for example : <br>
I set number of users 100<br>
I set end point of ""/signup"" and then <br>
I see 55 on table status of that end point , but on reality we have 100 users registered on database</p>

<p><br>
<br>
what I suppose to do, to make it properly work?</p>
",https://stackoverflow.com/questions/41735108/stress-testing-software-but-i-need-run-it-step-by-step-with-locust,"['stress-testing', 'locust']",157,TRUE,0,2
When I use Jmeter3.3 to excuse Distributed stress testing，I can&#39;t connect to the remote server,"<blockquote>
  <p>java.rmi.ConnectException: Connection refused to host: localhost;
  nested exception is:      java.net.ConnectException: Connection refused:
  connect   at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown
  Source) ~[?:1.8.0_111]    at
  sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
  ~[?:1.8.0_111]    at
  sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
  ~[?:1.8.0_111]    at sun.rmi.server.UnicastRef.newCall(Unknown Source)
  ~[?:1.8.0_111]    at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown
  Source) ~[?:1.8.0_111]    at java.rmi.Naming.lookup(Unknown Source)
  ~[?:1.8.0_111]    at
  org.apache.jmeter.engine.ClientJMeterEngine.getEngine(ClientJMeterEngine.java:54)
  ~[ApacheJMeter_core.jar:3.3 r1808647]     at
  org.apache.jmeter.engine.ClientJMeterEngine.(ClientJMeterEngine.java:67)
  ~[ApacheJMeter_core.jar:3.3 r1808647]     at
  org.apache.jmeter.engine.DistributedRunner.createEngine(DistributedRunner.java:237)
  ~[ApacheJMeter_core.jar:3.3 r1808647]     at
  org.apache.jmeter.engine.DistributedRunner.getClientEngine(DistributedRunner.java:213)
  ~[ApacheJMeter_core.jar:3.3 r1808647]     at
  org.apache.jmeter.engine.DistributedRunner.init(DistributedRunner.java:93)
  ~[ApacheJMeter_core.jar:3.3 r1808647]     at
  org.apache.jmeter.gui.action.RemoteStart.doAction(RemoteStart.java:86)
  ~[ApacheJMeter_core.jar:3.3 r1808647]     at
  org.apache.jmeter.gui.action.ActionRouter.performAction(ActionRouter.java:80)
  ~[ApacheJMeter_core.jar:3.3 r1808647]     at
  org.apache.jmeter.gui.action.ActionRouter.lambda$actionPerformed$0(ActionRouter.java:65)
  ~[ApacheJMeter_core.jar:3.3 r1808647]     at
  java.awt.event.InvocationEvent.dispatch(Unknown Source) [?:1.8.0_111]
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
  [?:1.8.0_111]     at java.awt.EventQueue.access$500(Unknown Source)
  [?:1.8.0_111]     at java.awt.EventQueue$3.run(Unknown Source)
  [?:1.8.0_111]     at java.awt.EventQueue$3.run(Unknown Source)
  [?:1.8.0_111]     at java.security.AccessController.doPrivileged(Native
  Method) ~[?:1.8.0_111]    at
  java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown
  Source) [?:1.8.0_111]     at java.awt.EventQueue.dispatchEvent(Unknown
  Source) [?:1.8.0_111]     at
  java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
  [?:1.8.0_111]     at
  java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
  [?:1.8.0_111]     at
  java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
  [?:1.8.0_111]     at java.awt.EventDispatchThread.pumpEvents(Unknown
  Source) [?:1.8.0_111]     at
  java.awt.EventDispatchThread.pumpEvents(Unknown Source) [?:1.8.0_111]
    at java.awt.EventDispatchThread.run(Unknown Source) [?:1.8.0_111]
  Caused by: java.net.ConnectException: Connection refused: connect     at
  java.net.DualStackPlainSocketImpl.connect0(Native Method)
  ~[?:1.8.0_111]    at
  java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
  ~[?:1.8.0_111]    at java.net.AbstractPlainSocketImpl.doConnect(Unknown
  Source) ~[?:1.8.0_111]    at
  java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
  ~[?:1.8.0_111]    at java.net.AbstractPlainSocketImpl.connect(Unknown
  Source) ~[?:1.8.0_111]    at java.net.PlainSocketImpl.connect(Unknown
  Source) ~[?:1.8.0_111]    at java.net.SocksSocketImpl.connect(Unknown
  Source) ~[?:1.8.0_111]    at java.net.Socket.connect(Unknown Source)
  ~[?:1.8.0_111]    at java.net.Socket.connect(Unknown Source)
  ~[?:1.8.0_111]    at java.net.Socket.(Unknown Source)
  ~[?:1.8.0_111]    at java.net.Socket.(Unknown Source)
  ~[?:1.8.0_111]    at
  sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown
  Source) ~[?:1.8.0_111]    at
  sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown
  Source) ~[?:1.8.0_111]    ... 28 more 2017-11-28 20:12:51,444 INFO
  o.a.j.e.DistributedRunner: Failed to configure localhost 2017-11-28
  20:12:51,444 INFO o.a.j.e.DistributedRunner: Configuring remote
  engine: 192.168.20.16 2017-11-28 20:12:51,528 INFO
  o.a.j.e.DistributedRunner: Configuring remote engine: 192.168.20.142
  2017-11-28 20:12:54,604 INFO o.a.j.e.DistributedRunner: Configuring
  remote engine: 192.168.20.57 2017-11-28 20:12:54,711 INFO
  o.a.j.e.DistributedRunner: Stopping remote engines 2017-11-28
  20:12:54,711 INFO o.a.j.e.ClientJMeterEngine: about to stop remote
  test on 192.168.20.57 2017-11-28 20:12:54,745 ERROR
  o.a.j.e.ClientJMeterEngine:  java.lang.NullPointerException: null     at
  org.apache.jmeter.engine.RemoteJMeterEngineImpl.rstopTest(RemoteJMeterEngineImpl.java:198)
  ~[ApacheJMeter_core.jar:3.3 r1808647]     at
  sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  ~[?:1.8.0_111]    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown
  Source) ~[?:1.8.0_111]    at
  sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
  ~[?:1.8.0_111]    at java.lang.reflect.Method.invoke(Unknown Source)
  ~[?:1.8.0_111]    at sun.rmi.server.UnicastServerRef.dispatch(Unknown
  Source) ~[?:1.8.0_111]    at sun.rmi.transport.Transport$1.run(Unknown
  Source) ~[?:1.8.0_111]    at sun.rmi.transport.Transport$1.run(Unknown
  Source) ~[?:1.8.0_111]    at
  java.security.AccessController.doPrivileged(Native Method)
  ~[?:1.8.0_111]    at sun.rmi.transport.Transport.serviceCall(Unknown
  Source) ~[?:1.8.0_111]    at
  sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
  ~[?:1.8.0_111]    at
  sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown
  Source) ~[?:1.8.0_111]    at
  sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(Unknown
  Source) ~[?:1.8.0_111]    at
  java.security.AccessController.doPrivileged(Native Method)
  ~[?:1.8.0_111]    at
  sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown
  Source) ~[?:1.8.0_111]    at
  java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
  ~[?:1.8.0_111]    at
  java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
  ~[?:1.8.0_111]    at java.lang.Thread.run(Unknown Source) ~[?:1.8.0_111]
    at
  sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown
  Source) ~[?:1.8.0_111]    at
  sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
  ~[?:1.8.0_111]    at sun.rmi.server.UnicastRef.invoke(Unknown Source)
  ~[?:1.8.0_111]    at
  java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(Unknown
  Source) ~[?:1.8.0_111]    at
  java.rmi.server.RemoteObjectInvocationHandler.invoke(Unknown Source)
  ~[?:1.8.0_111]    at com.sun.proxy.$Proxy21.rstopTest(Unknown Source)
  ~[?:?]    at
  org.apache.jmeter.engine.ClientJMeterEngine.stopTest(ClientJMeterEngine.java:84)
  ~[ApacheJMeter_core.jar:3.3 r1808647]     at
  org.apache.jmeter.engine.DistributedRunner.stop(DistributedRunner.java:157)
  ~[ApacheJMeter_core.jar:3.3 r1808647]     at
  org.apache.jmeter.engine.DistributedRunner.stop(DistributedRunner.java:174)
  ~[ApacheJMeter_core.jar:3.3 r1808647]     at
  org.apache.jmeter.engine.DistributedRunner.init(DistributedRunner.java:111)
  ~[ApacheJMeter_core.jar:3.3 r1808647]     at
  org.apache.jmeter.gui.action.RemoteStart.doAction(RemoteStart.java:86)
  ~[ApacheJMeter_core.jar:3.3 r1808647]     at
  org.apache.jmeter.gui.action.ActionRouter.performAction(ActionRouter.java:80)
  ~[ApacheJMeter_core.jar:3.3 r1808647]     at
  org.apache.jmeter.gui.action.ActionRouter.lambda$actionPerformed$0(ActionRouter.java:65)
  ~[ApacheJMeter_core.jar:3.3 r1808647]     at
  java.awt.event.InvocationEvent.dispatch(Unknown Source) [?:1.8.0_111]
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
  [?:1.8.0_111]     at java.awt.EventQueue.access$500(Unknown Source)
  [?:1.8.0_111]     at java.awt.EventQueue$3.run(Unknown Source)
  [?:1.8.0_111]     at java.awt.EventQueue$3.run(Unknown Source)
  [?:1.8.0_111]     at java.security.AccessController.doPrivileged(Native
  Method) ~[?:1.8.0_111]    at
  java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown
  Source) [?:1.8.0_111]     at java.awt.EventQueue.dispatchEvent(Unknown
  Source) [?:1.8.0_111]     at
  java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
  [?:1.8.0_111]     at
  java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
  [?:1.8.0_111]     at
  java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
  [?:1.8.0_111]     at java.awt.EventDispatchThread.pumpEvents(Unknown
  Source) [?:1.8.0_111]     at
  java.awt.EventDispatchThread.pumpEvents(Unknown Source) [?:1.8.0_111]
    at java.awt.EventDispatchThread.run(Unknown Source) [?:1.8.0_111]
  2017-11-28 20:12:54,745 INFO o.a.j.e.ClientJMeterEngine: about to stop
  remote test on 192.168.20.142</p>
</blockquote>
",https://stackoverflow.com/questions/47544089/when-i-use-jmeter3-3-to-excuse-distributed-stress-testing-i-cant-connect-to-the,['jmeter'],920,FALSE,0,1
Ag-grid: Data Size Limitation for Enterprise license,"<p>I am integrating ag-grid in my product and wondering if anyone has done stress testing of ag-grid to see the limits of # of rows/#of columns (or file size) can break ag-grid?</p>
",https://stackoverflow.com/questions/45170833/ag-grid-data-size-limitation-for-enterprise-license,"['ag-grid', 'ag-grid-react']",1179,FALSE,0,1
Reproduce Android Monkey Script,"<p>I ran the Monkey tool (the tool to perform stress testing on Android application) and I got some script file that have this form:</p>

<pre><code>type= raw events
count= -1
speed= 1.0
start data &gt;&gt;
LaunchActivity(com.amaze.filemanager,com.amaze.filemanager.activities.MainActivity)
DispatchPointer(6934862,6934862,0,517.0,124.0,0.0,0.0,0,1.0,1.0,0,0)
DispatchPointer(6934862,6934867,1,520.041,127.07279,0.0,0.0,0,1.0,1.0,0,0)
GUIGen(3)
DispatchTrackball(-1,6945789,2,1.0,-3.0,0.0,0.0,0,1.0,1.0,0,0)
...
</code></pre>

<p>I would like to re-execute such sequence of events again, using the produced script.
How can I do that?</p>
",https://stackoverflow.com/questions/46669486/reproduce-android-monkey-script,"['android', 'monkey']",1321,TRUE,5,1
Why does my Android app crash with error GC tried to mark invalid reference?,"<p>When stress-testing my Android app on Android 8.0 in cases involving a high degree of memory churn, the app crashes during garbage collection with the message <code>GC tried to mark invalid reference</code>.</p>

<p>The app works fine on other versions of Android - what is going on?</p>
",https://stackoverflow.com/questions/46621349/why-does-my-android-app-crash-with-error-gc-tried-to-mark-invalid-reference,['android'],704,TRUE,1,1
Apache JMeter : Add random data in body for request,"<p>I'm working on stress testing our application in Apache JMeter.</p>

<p>I thought of calling register user method which will add users in the database. But if the email already exists, then the database action does not take place.</p>

<p>How can I add a random number in body data? Or is there some other way I can stress test my application connected with database? </p>

<p>Here are some screenshots :
<a href=""https://i.stack.imgur.com/lYr2r.png"" rel=""noreferrer""><img src=""https://i.stack.imgur.com/lYr2r.png"" alt=""enter image description here""></a><a href=""https://i.stack.imgur.com/O1JhP.png"" rel=""noreferrer""><img src=""https://i.stack.imgur.com/O1JhP.png"" alt=""enter image description here""></a></p>

<p>Controller code :</p>

<pre><code>@RequestMapping(value = ""/person/add"", method = RequestMethod.POST)
public String addPerson(@ModelAttribute(""person"") Person person, BindingResult bindingResult) {
    System.out.println(""Person add called""+person.getUsername());
    person.setUsername(this.stripHTML(person.getUsername()));
    int personId = this.personService.addPerson(person);
    if (!(personId == 0)) {
        Person person1 = this.personService.getPersonById(personId);
        Collection&lt;GrantedAuthority&gt; authorities = new ArrayList&lt;&gt;();
        authorities.add(new SimpleGrantedAuthority(""ROLE_USER""));
        Authentication authentication = new UsernamePasswordAuthenticationToken(person1, null, authorities);
        SecurityContextHolder.getContext().setAuthentication(authentication);
        return ""redirect:/canvaslisting"";
    } else {
        return ""redirect:/"";
    }
}
</code></pre>
",https://stackoverflow.com/questions/44800557/apache-jmeter-add-random-data-in-body-for-request,"['java', 'random', 'jmeter', 'stress-testing']",31764,TRUE,18,3
Apache Jmeter : Post an object not working with ModelAttribute,"<p>I am working on stress testing our webapplication written in Spring-MVC. </p>

<p>I would like to send an object <code>Person</code> to the application. I have added a system out to get the email, but whenever I am sending the object, it is null. What am I doing wrong? </p>

<p>Server code :</p>

<pre><code>@RequestMapping(value = ""/person/add"", method = RequestMethod.POST)
    public String addPerson(@ModelAttribute(""person"") Person person, BindingResult bindingResult) {
        try {
            ObjectMapper mapper = new ObjectMapper();

            String json = mapper.writeValueAsString(person);
            System.out.println(""String is ""+json);
        }catch (Exception e){
            e.printStackTrace();
        }


        System.out.println(""Person add called""+person.getUsername());
        person.setUsername(this.stripHTML(person.getUsername()));
        int personId = this.personService.addPerson(person);
        if (!(personId == 0)) {
            Person person1 = this.personService.getPersonById(personId);
            Collection&lt;GrantedAuthority&gt; authorities = new ArrayList&lt;&gt;();
            authorities.add(new SimpleGrantedAuthority(""ROLE_USER""));
            Authentication authentication = new UsernamePasswordAuthenticationToken(person1, null, authorities);
            SecurityContextHolder.getContext().setAuthentication(authentication);
            return ""redirect:/canvaslisting"";
        } else {
            return ""redirect:/"";
        }
    }
</code></pre>

<p>Object sent  in body data :</p>

<pre><code>{""person"":{""id"":0,""username"":""testemail@gmail.com"",""firstName"":""test"",""cleanCacheFlag"":false,""googleDrive"":false,""dropbox"":false,""evernoteConsumed"":false,""statusChangeTimeStamp"":null,""useCalendar"":false,""newsletterFlag"":false,""tourSteps"":null,""profession"":null,""notiz"":null,""telePhone"":null,""lastVisitedBoards"":null,""leftGroup"":null,""optionalEmail"":null,""facebookLink"":null,""xingLink"":null,""linkedinLink"":null,""lastOnlineTimestamp"":null,""userRole"":null,""homePage"":null,""excelImportQuota"":0,""toEmail"":null,""code"":null,""authorities"":null,""role"":null,""newpassword"":null,""token"":null,""profilePhotoString"":null,""accountNonExpired"":true,""credentialsNonExpired"":true,""accountNonLocked"":true,""active"":true,""enabled"":false}
}
</code></pre>

<p>Output :</p>

<pre><code>Person add callednull
</code></pre>

<p>Screenshot :<a href=""https://i.stack.imgur.com/BHqL7.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/BHqL7.png"" alt=""enter image description here""></a></p>

<p><em>Sample result</em></p>

<pre><code>Thread Name: Thread Group 2-5
Sample Start: 2017-06-29 15:17:11 IST
Load time: 6
Connect Time: 0
Latency: 6
Size in bytes: 237
Sent bytes:0
Headers size in bytes: 205
Body size in bytes: 32
Sample Count: 1
Error Count: 1
Data type (""text""|""bin""|""""): text
Response code: 415
Response message: Unsupported Media Type

Response headers:
HTTP/1.1 415 Unsupported Media Type
Server: Apache-Coyote/1.1
Content-Type: text/html;charset=utf-8
Content-Language: en
Content-Length: 1048
Date: Thu, 29 Jun 2017 09:47:11 GMT
Connection: close


HTTPSampleResult fields:
ContentType: text/html;charset=utf-8
DataEncoding: utf-8
</code></pre>

<p>Request: </p>

<pre><code>POST http://127.0.0.1:8080/person/add/

POST data:
{""person"":{""id"":0,""username"":""testemail@gmail.com"",""firstName"":""test"",""cleanCacheFlag"":false,""googleDrive"":false,""dropbox"":false,""evernoteConsumed"":false,""statusChangeTimeStamp"":null,""useCalendar"":false,""newsletterFlag"":false,""tourSteps"":null,""profession"":null,""notiz"":null,""telePhone"":null,""lastVisitedBoards"":null,""leftGroup"":null,""optionalEmail"":null,""facebookLink"":null,""xingLink"":null,""linkedinLink"":null,""lastOnlineTimestamp"":null,""userRole"":null,""homePage"":null,""excelImportQuota"":0,""toEmail"":null,""code"":null,""authorities"":null,""role"":null,""newpassword"":null,""token"":null,""profilePhotoString"":null,""accountNonExpired"":true,""credentialsNonExpired"":true,""accountNonLocked"":true,""active"":true,""enabled"":false}
}

[no cookies]

Request Headers:
Connection: close
Content-Length: 717
Content-Type: application/x-www-form-urlencoded
</code></pre>
",https://stackoverflow.com/questions/44821086/apache-jmeter-post-an-object-not-working-with-modelattribute,"['java', 'json', 'spring', 'spring-mvc', 'jmeter']",1214,TRUE,1,3
How to catch a &quot;Maximum call stack size exceeded&quot; error in javascript?,"<p>I am using a js tree view plugin for my app, and I am doing some stress testing. In my test, I load 200k files into this plugin. And then the plugin crashes in chrome like this:</p>

<pre><code>Uncaught RangeError: Maximum call stack size exceeded
    at Function.fb [as find] (jquery.min.js:2)
    at m.fn.init.find (jquery.min.js:2)
    at a.jstree.core.init (jstree.min.js:2)
    at Object.a.jstree.create (jstree.min.js:2)
    at HTMLDivElement.&lt;anonymous&gt; (jstree.min.js:2)
    at Function.each (jquery.min.js:2)
    at m.fn.init.each (jquery.min.js:2)
    at m.fn.init.a.fn.jstree (jstree.min.js:2)
    at renderView (main.js:274)
    at Worker.myWorker.onmessage (main.js:232)
</code></pre>

<p>But I don't want the whole page to crash. Is there a way I can catch this error? And how would I simulate this to test so I can see if I can catch it, as running my usual test would take all night.</p>

<p>Thanks</p>
",https://stackoverflow.com/questions/47782725/how-to-catch-a-maximum-call-stack-size-exceeded-error-in-javascript,"['javascript', 'error-handling']",258,FALSE,1,0
VB.Net SQLite &quot;delayed 25ms for lock/sharing conflict&quot;,"<p>Stress testing insertion of 1 million records in SQLite + VB.net for learning purposes.  Getting the following in my console which seems to be severely limiting my speeds.  </p>

<blockquote>
  <p>SQLite notice (27): delayed 25ms for lock/sharing conflict at line
  42982</p>
</blockquote>

<p>Btw, I know a transaction would probably be better here but I still would like to know why I am receiving this message.  Also tried the solution from this SO Question, didn't work for me:  <a href=""https://stackoverflow.com/questions/14394280/sqlite-error-10-delayed-25ms-for-lock-sharing-conflict"">SQLite error (10): delayed 25ms for lock/sharing conflict</a></p>

<pre><code>Imports System.Data.SQLite

Public Class Form1


    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim sw As New Stopwatch
        sw.Start()
        Using conn As New SQLiteConnection(""Data Source=test.db;Version=3"")
            conn.Open()
            Using cmd As New SQLiteCommand(""INSERT INTO test VALUES (1)"", conn)
                For I = 0 To 1000000
                    cmd.ExecuteNonQuery()
                Next
            End Using
        End Using
        sw.Stop()
        Debug.WriteLine(""Completed! "" &amp; sw.ElapsedMilliseconds)
    End Sub

End Class
</code></pre>
",https://stackoverflow.com/questions/43748811/vb-net-sqlite-delayed-25ms-for-lock-sharing-conflict,"['vb.net', 'sqlite']",402,TRUE,0,1
Determine server requirements for PHP application,"<p>I'm currently working on a web app and if all goes to plan, it could very well grow extremely quickly. This is the first app I'm building where server requirements are a big question to me. What can I do to determine how much bandwidth, ram, and processing power I'm going to need?</p>

<p>Is there a specific term to what I'm trying to find out here? I've heard of stress testing but I'm not sure that's what this is.</p>

<p>Any help would be great. </p>
",https://stackoverflow.com/questions/46571734/determine-server-requirements-for-php-application,"['php', 'server', 'performance-testing', 'stress-testing']",511,TRUE,0,1
How to login a large number of users in Jmeter?,"<p>I have a project and need to test a large number of of users in Jmeter but the problem  I am facing is how to login lots of users, it will be tedious for me to enter their data manually and the token.</p>

<p>Can we remove or bypass the session id/token? So I won't need to input it manually. Is there any simple way to login lacks of user so I can test the load and stress testing. Or is there any other open source tool in which I test this?</p>
",https://stackoverflow.com/questions/45896225/how-to-login-a-large-number-of-users-in-jmeter,"['performance', 'testing', 'automation', 'jmeter', 'automated-tests']",577,TRUE,0,2
Implementation of Bellman-Ford algorithm in python,"<p>I am doing an exercise for the course ""Algorithms on Graphs"" on Coursera and I have to implement the Bellman-Ford algorithm to detect if a graph has a negative cycle or not, outputting 1 and 0 respectively. I did a lot of stress testing and my implementation works fine, but it fails on one of the test cases on the course (but they don't give any information about it, other than ""wrong answer""). My implementation is just the same one you find all over the web, and because of that I can't see what is wrong with my code. Any ideas?</p>

<pre><code>def relax(u,v,w,dist,prev):
    if dist[u]+w &lt; dist[v]:
        dist[v] = dist[u]+w
        prev[v] = u

def bellmanFord(V,E):
    dist = [float('inf')] * V
    prev = [None] * V
    dist[0] = 0

    for i in range(V-1):
        for edge in E:
            relax(edge[0],edge[1],edge[2],dist,prev)

    #checks for negative cycles        
    for e in E:
        u = e[0]
        v = e[1]
        w = e[2]
        if dist[u]+w &lt; dist[v]:
            return 1

    return 0
</code></pre>
",https://stackoverflow.com/questions/41517416/implementation-of-bellman-ford-algorithm-in-python,"['python', 'algorithm', 'graph', 'shortest-path']",5828,TRUE,2,2
Running TestNG tests multiple times,"<p>I want to implement some sort of stress-testing using Gradle and TestNG / JUnit.</p>

<p>I found <a href=""https://stackoverflow.com/a/41650455"">https://stackoverflow.com/a/41650455</a> which is working perfectly fine with JUnit, but it does not work with TestNG. I created a small repo to show my issue:</p>

<p><a href=""https://github.com/dhardtke/gradle-testng-stresstest"" rel=""nofollow noreferrer"">https://github.com/dhardtke/gradle-testng-stresstest</a></p>

<p>If I run <code>gradlew stressTestJUnit</code> I correctly receive</p>

<pre><code>JUnitTests &gt; testNothing STANDARD_ERROR
    I am a JUnit test!

JUnitTests &gt; testNothing STANDARD_ERROR
    I am a JUnit test!

JUnitTests &gt; testNothing STANDARD_ERROR
    I am a JUnit test!

JUnitTests &gt; testNothing STANDARD_ERROR
    I am a JUnit test!

JUnitTests &gt; testNothing STANDARD_ERROR
    I am a JUnit test!
</code></pre>

<p>but when running <code>gradlew stressTestTestNG</code> I only receive:</p>

<pre><code>Gradle suite &gt; Gradle test &gt; TestNGTests.testNothing STANDARD_ERROR
    I am a TestNG test!
</code></pre>

<p>I already tried figuring out what Gradle does differently when executing TestNG tests instead of JUnit tests, but couldn't figure it out (yet): <a href=""https://github.com/gradle/gradle/tree/master/subprojects/testing-jvm/src/main/java/org/gradle/api/internal/tasks/testing/testng"" rel=""nofollow noreferrer"">https://github.com/gradle/gradle/tree/master/subprojects/testing-jvm/src/main/java/org/gradle/api/internal/tasks/testing/testng</a></p>
",https://stackoverflow.com/questions/47116859/running-testng-tests-multiple-times,"['java', 'gradle', 'testng', 'stress-testing']",265,FALSE,0,1
Django shows Python socket.error: [Errno 104] Connection reset by peer,"<p>I have a django+mysql website on AWS.</p>

<p>Client send post request to website, then the website query the mysql database and return a json. </p>

<p>I am doing stress testing to it.
I send 300 post requests simultaneously to the website and get responses correctly.
But if I increase the number of post request to 400, it fails with following log.</p>

<p>Server side :</p>

<pre><code>File ""/usr/lib/python2.7/wsgiref/handlers.py"", line 86, in run 
self.finish_response() 
File ""/usr/lib/python2.7/wsgiref/handlers.py"", line 128, in    finish_response 
self.write(data) 
File ""/usr/lib/python2.7/wsgiref/handlers.py"", line 212, in write 
self.send_headers() 
File ""/usr/lib/python2.7/wsgiref/handlers.py"", line 270, in    send_headers self.send_preamble() 
File ""/usr/lib/python2.7/wsgiref/handlers.py"", line 191, in  send_preamble self._write('HTTP/%s %s\r\n' %  (self.http_version,self.status)) 
File ""/usr/lib/python2.7/wsgiref/handlers.py"", line 391, in _write  self.stdout.write(data) 
File ""/usr/lib/python2.7/socket.py"", line 328, in write 
</code></pre>

<p>self.flush() 
    File ""/usr/lib/python2.7/socket.py"", line 307, in flush self._sock.sendall(view[write_offset:write_offset+buffer_size]) error:   [Errno 104] Connection reset by peer</p>

<p>Client side:</p>

<pre><code>HTTPConnectionPool(host='mywebsite.com', port=3456): Max retries exceeded with url: /project/result.json (Caused by &lt;class 'socket.error'&gt;: [Errno 104] Connection reset by peer)
</code></pre>

<p>I have tuned the mysql configuration for higher max_connections and timeout but it doesn't work.</p>

<p>Can anyone help me to resolve the issue? Thanks.</p>
",https://stackoverflow.com/questions/42642009/django-shows-python-socket-error-errno-104-connection-reset-by-peer,"['mysql', 'django', 'python-2.7', 'high-traffic']",2421,FALSE,2,0
PostgreSQL random performance hit on simple queries,"<p>We have a bunch of java REST services which uses local database for various use-cases. We have noticed that, while stress testing these services (20 concurrent clients making various requests), some of the requests (roughly 10 out of 1000) take about 5-10 seconds while the average is 50-100 milliseconds. </p>

<p>I have isolated the issue down to the database operations. These are all very simple operations on small/empty tables. So, I have done the following to get more info:</p>

<ul>
<li>Set JDBC connection pool's <code>setMaxWait</code> setting to 1 second, in order to catch pool queue issues. No exception has been thrown yet.</li>
<li>Set <code>deadlock_timeout</code> setting to 200 milliseconds and enabled <code>log_lock_waits</code> on <strong><em>postgresql.conf</em></strong> file in order to catch if there is any lock causes this. I've seen no such logs in postgresql.</li>
<li><p>Enabled and set <code>log_min_duration_statement</code> to 1500 milliseconds to make sure the database operations were indeed the cause. A sample (<code>gce_resolver</code> is an empty table at this point): </p>

<blockquote>
  <p>2017-08-09 10:15:21 CEST LOG duration: 1597.000 ms  bind : /* SiteDao.getAllGceResolvers */ SELECT * FROM gce_resolver ORDER BY name    </p>
</blockquote></li>
<li><p>Sounds like unrelated but just to be sure, enabled <code>log_autovacuum_min_duration</code> by setting it to <code>0</code>. No relevant logs were produced at the time of the stress testing.</p></li>
<li><p>Enabled <code>auto_explain</code> and set the <code>auto_explain.log_min_duration</code> to 1000 as well as <code>auto_explain.log_verbose</code> to <code>on</code>. A sample: </p>

<pre><code>2017-08-09 10:20:59 CEST LOG:  duration: 2881.699 ms  plan:
Query Text: /* UserLicenseDao.insertLicense */ INSERT INTO user_license (user_dn, created) VALUES ($1, $2)
Insert on public.user_license  (cost=0.00..0.01 rows=1 width=0)
  -&gt;  Result  (cost=0.00..0.01 rows=1 width=0)
        Output: NULL::integer, 'CN=user172,OU=local'::text, '2017-08-09 10:20:56.153'::timestamp without time zone
</code></pre></li>
</ul>

<p>It's a very simple insert, which looks like it <em>cost</em> very little, but somehow took almost 3 seconds for some reason. Now I'm out of ideas. What could be causing this delay? And why sometimes?</p>

<p>PostgreSQL 9.4.12</p>
",https://stackoverflow.com/questions/45586115/postgresql-random-performance-hit-on-simple-queries,"['postgresql', 'jdbc', 'database-performance']",191,FALSE,1,0
Strange error in an algorithm written in Python to find the Least Common Multiple,"<p>For educational purposes, I am trying to build an efficient algorithm to find the Least Common Multiple. I already have a quadratic and slow implementation for that. I am trying to build a new one. My new implementation uses a math property involving the Greatest Common Divisor (GCD) and the Least Common Multiple (LCM).</p>

<p>Basically: For any two positive integers a and b,</p>

<pre><code>LCM(a, b) * GCD(a, b) = a * b
</code></pre>

<p>I am using Python 3 for that.</p>

<p>I have a very efficient implementation for GCD (it uses another math property, but it is pointless to talk about that):</p>

<pre><code>def euclidean_gcd(a,b):
    if b == 0:
        return a
    else:
        a_prime = a%b
        return euclidean_gcd(b,a_prime)
</code></pre>

<p>My implementation for LCM is:</p>

<pre><code>def lcm_fast(a,b):
    return (int((a*b)/(euclidean_gcd(a,b))))
</code></pre>

<p>However, when I call:</p>

<pre><code>lcm_fast(1023473145,226553150)
</code></pre>

<p>I get as an output:</p>

<pre><code>46374212988031352
</code></pre>

<p>The correct answer would be a close number:</p>

<pre><code>46374212988031350
</code></pre>

<p>I am a beginner (second year on the Applied Math major), why is this happening?</p>

<p>I am not sure if I could grasp the concept of integer overflow, but, according to my understanding above a little research I did, there is no integer overflow in Python. </p>

<p>I did stress testing and tried to find this mistake in a easier to understand case. However, the problem seems to happen only with really big numbers. Bellow you can check my stress testing for that:</p>

<pre><code>import random

#defina a fronteira máxima dos testes randômicos

print (""insira um número para ser o final do intervalo de testes aleatórios"")
bound_right = int(input())

#versão lenta, ou naive

def check_elem_in_list(list_1,list_2):
    for element in list_1:
        if element in list_2:
            return element
    else:
        return False

#nested loops, vai ter comportamento quadrático

def lcm_slow(num_1,num_2):

    list_of_num_1_prod = []
    list_of_num_2_prod = []
    max_nums = max(num_1,num_2)
    end_range = max_nums +1
    for i in range(1, end_range):
        list_of_num_1_prod.append(i*num_1)
        list_of_num_2_prod.append(i*num_2)
        if check_elem_in_list(list_of_num_1_prod,list_of_num_2_prod) != False:
            return (check_elem_in_list(list_of_num_1_prod,list_of_num_2_prod))

def euclidean_gcd(a,b):
    if b == 0:
        return a
    else:
        a_prime = a%b
        return euclidean_gcd(b,a_prime)

def lcm_fast(a,b):
    return (int((a*b)/(euclidean_gcd(a,b))))


# está dando pau com os inputs 1023473145, 226553150
# vou fazer stress testing
#primeiro, fazer função para gerar testes

a_in = random.randint(1,bound_right)
b_in = random.randint(1,bound_right)


while (lcm_slow(a_in,b_in)==lcm_fast(a_in,b_in)):
    a_in = random.randint(1,bound_right)
    b_in = random.randint(1,bound_right)
    print (a_in,b_in,""OK"",lcm_fast(a_in,b_in),lcm_slow(a_in,b_in))
    if (lcm_slow(a_in,b_in)!=lcm_fast(a_in,b_in)):
        print (a_in, b_in,""OPS"",lcm_fast(a_in,b_in),lcm_slow(a_in,b_in))
        break
</code></pre>

#

<p>EDITED AFTER SOME COMMENTS/ANSWERS TO THE ORIGINAL PROBLEM</p>

<p>Inside this problem, a new problem arrives.
I am building this for a platform. My solution is right. After the comment from Blender. I did that (which was my original solution):</p>

<pre><code>def lcm_fast(a,b):
    a = ((a*b)/(euclidean_gcd(a,b)))
    return a
</code></pre>

<p>The problem is that I receive this message failing on the platform's test cases:</p>

<pre><code>Failed case #1/42: Cannot check answer. Perhaps output format is wrong. 

Input: 18 35 Your output: 630.0 Correct output: 630 (Time used: 0.01/5.00, memory used: 9613312/536870912.)
</code></pre>

<p>That's funny. If I avoid the approximation with <code>int()</code>, the code is right for big numbers. However, without the conversion from <code>float</code> to <code>int</code>, I am unable to provide the answer on the desired format.</p>
",https://stackoverflow.com/questions/43507655/strange-error-in-an-algorithm-written-in-python-to-find-the-least-common-multipl,"['python-3.x', 'stress-testing', 'greatest-common-divisor']",222,TRUE,3,2
Loading Screen with React Component,"<p>I have a Component Pulling a large amount of data as I am stress testing it. I am pulling the data using promises in the <code>componentWillMount</code> life cycle. There is about an 8 second delay on the timeline to load this data. So I obviously need a load bar. </p>

<p>What is the proper way to implement this? I would like my SVG not to be within the Component, but fixed in the highest component so that the load bar appears in the middle of the screen and not in the Component.</p>

<p>Which Lifecycle should I use and on which component? Is there a global solution so I don't have to implement a load bar on every component that needs this solution?</p>
",https://stackoverflow.com/questions/43104921/loading-screen-with-react-component,"['reactjs', 'load', 'lifecycle']",287,FALSE,0,0
Issue when Undertow used with spring boot app,"<p>I have a spring boot app running with default embedded tomcat (with tomcat jdbc connection pooling). It is production and running fine. I am using mysql as my database.</p>

<p>I am now doing some stress testing in my test environment and trying to see if I get any obvious benefit if I switch from <strong>embedded Tomcat</strong> to <strong>embedded Undertow</strong>. People claim to get visible improvement in their throughput by doing this due to the asynchronous nature of undertow request handling.</p>

<p>I know how to exclude tomcat and add undertow to boot app. After doing that, I am trying to run my stress-testing script to roughly generate 500 requests per second, run it for 5 minutes under this load and see how it behaves. When I do this, after initial few seconds, I start getting jdbc exceptions as given below intermittently.</p>



<pre><code> org.springframework.transaction.CannotCreateTransactionException: Could not open JPA EntityManager for transaction; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.JDBCConnectionException: Unable to acquire JDBC Connection 
     at org.springframework.orm.jpa.JpaTransactionManager.doBegin(JpaTransactionManager.java:431) ~[spring-orm-4.3.2.RELEASE.jar!/:4.3.2.RELEASE]
     at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:373) ~[spring-tx-4.3.2.RELEASE.jar!/:4.3.2.RELEASE]
     at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:426) ~[spring-tx-4.3.2.RELEASE.jar!/:4.3.2.RELEASE]
     at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:275) ~[spring-tx-4.3.2.RELEASE.jar!/:4.3.2.RELEASE]
     at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) ~[spring-tx-4.3.2.RELEASE.jar!/:4.3.2.RELEASE]
     at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.3.2.RELEASE.jar!/:4.3.2.RELEASE]
     at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136) ~[spring-tx-4.3.2.RELEASE.jar!/:4.3.2.RELEASE]
     at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.3.2.RELEASE.jar!/:4.3.2.RELEASE]
     at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:133) ~[spring-data-jpa-1.10.2.RELEASE.jar!/:na]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.3.2.RELEASE.jar!/:4.3.2.RELEASE]
</code></pre>



<p>It means jdbc connection can not be acquired.</p>

<p><strong>NOTE</strong>: If I remove embedded undertow and again add embedded tomcat to my app, then same test runs fine without any jdbc-connection related exceptions.</p>

<p>My underlying Tomcat-jdbc-pool has 100 db-connection. For undertow, I tried with 100 worker threads and 100 io-threads.</p>

<p>I also tried using HikariCP instead of default tomcat-jdbc-pooling. I tried HikariCP with maximumPoolSize=100 and connectionTimeOut=60000. Again embedded-Tomcat+HikariCP runs fine under this stress-test. But embedded-Undertow+HikariCP gives similar exceptions.</p>

<p>So there is something different happening when I bring in Undertow in the picture. But I am not able to understand it. Please note that these exceptions come intermittently, but come for sure in every run of my stress-test when Undertow is used.</p>

<p>I generally searched for such issues. In general I don't find such common crib for Undertow.</p>

<p>Any help to analyse the situation will save lot of time.</p>
",https://stackoverflow.com/questions/45350650/issue-when-undertow-used-with-spring-boot-app,"['java', 'mysql', 'tomcat', 'spring-boot', 'undertow']",1410,FALSE,1,1
"Custom processor and backpressuring, throttling","<p>NiFi 1.2.0</p>

<p>There is a custom processor that reads data from db and passes it further. In a recent stress testing, the 'success' relationship queue was clogged and also the later flow as the processor dumped hundred thousands of flow files of several GBs. Obviously, the <a href=""https://nifi.apache.org/docs/nifi-docs/html/getting-started.html#connecting-processors"" rel=""nofollow noreferrer"">backpressuring</a>  was not implemented. I also read an informative <a href=""https://community.hortonworks.com/content/kbentry/9785/nifihdf-dataflow-optimization-part-2-of-2.html"" rel=""nofollow noreferrer"">post</a> about throttling and backpressuring.</p>

<p>What I have figured out is that backpressuring is something we configure in the relationship queue and standard processors like ControlRate can help to regulate the data flow.</p>

<p>Question :</p>

<p>Is additional coding required(e.g: Some interface to be implemented) in the processor to enable it to 'sleep/stop consuming data' for backpressuring or does the NiFi framework handle that, once the 'success' relationship of  the processor is configured for backpressuring</p>
",https://stackoverflow.com/questions/44886429/custom-processor-and-backpressuring-throttling,['apache-nifi'],622,TRUE,0,1
Visual Studio Web Performance Test - Using Multiple Rows From One Data Source in One Test,"<p>I am a bit new to Performance, Load, and Stress testing, and so I apologize if I do not explain myself well.</p>

<p>I have created a performance test that attempts to log in three times. The first two times it fails, but the third it should work. I attached two Data Source files to the test. One contains invalid login credentials and the other contains valid login credentials.</p>

<p>Would I have to attach the invalid login credential data source twice, and have the first failed log in attempt use one, and the second use the other? That way the first and second failed login attempts do not use the same row from the data source? Is there a way to have the test choose another row from the data source?</p>

<p>Any help is much appreciated!
Thank you!</p>
",https://stackoverflow.com/questions/47639888/visual-studio-web-performance-test-using-multiple-rows-from-one-data-source-in,"['visual-studio', 'datasource', 'performance-testing', 'load-testing']",84,FALSE,0,0
&quot;nice&quot; command not working on macOS,"<p>I'm trying to run a particular process that is using all the processor time using nice:</p>

<pre><code>sudo nice -n 20 someProcess
</code></pre>

<p>Unfortunately, this doesn't change anything. In Activity Monitor, it's still pegging at 99% of the CPU.</p>

<p>I was suspicious that this might be due to the fact that there wasn't much going on, so it was perfectly able to use that much time, so I tried stress-testing with:</p>

<p>yes > /dev/null &amp; yes > /dev/null &amp; yes > /dev/null &amp; yes > /dev/null &amp;</p>

<p>Even with nice -n 20, the process in question used 99% of the CPU, pushing the four ""yes"" processes down from 99% to around 60% each.</p>

<p>I should note that I also tried using ""nice"" with one ""yes"" process similarly, and found that it made no difference at all... that ""yes"" process used as much processor time as all the others.</p>

<p>What's going on? Is ""nice"" broken? This was done on macOS 10.12.5.</p>
",https://stackoverflow.com/questions/44811425/nice-command-not-working-on-macos,"['macos', 'nice']",3056,TRUE,5,4
Integration Testing and Load Testing : using the same scenarii (JVM),"<p>At the moment, I'm using two different frameworks for REST APIs integration testing, and load/stress testing. Respectively : <a href=""http://gebish.org"" rel=""nofollow noreferrer"">geb</a> (or cucumber) and <a href=""http://gatling.io"" rel=""nofollow noreferrer"">gatling</a>. But most of the time, I'm re-writing some  pieces of code in load / performance scenarii that I've been writing for integration testing.</p>

<p>So the question is : is there a framework (running on the JVM) or simply a way, to write integration tests (for a strict REST API use case), preferably programmatically, then assemble load testing scenarios using these integration tests.</p>

<p>I've read <a href=""http://blog.mattwynne.net/2012/03/13/using-cucumber-for-load-testing/"" rel=""nofollow noreferrer"">cucumber</a> maybe could do that, but I'm lacking a proper example.</p>

<p>The requirements : </p>

<ul>
<li><p>write integration tests programmatically</p></li>
<li><p>for any integration test, have the ability to ""extract"" values (the same way gatling can extract json paths for instance)</p></li>
<li><p>assemble the integration tests in a load test scenario</p></li>
</ul>

<p>If anyone has some experience to share, I'd be happy to read any blog article, GitHub repository, or whatever source dealing with such an approach.</p>

<p>Thanks in advance for your help.</p>
",https://stackoverflow.com/questions/44434546/integration-testing-and-load-testing-using-the-same-scenarii-jvm,"['cucumber', 'integration-testing', 'load-testing', 'geb', 'gatling']",476,TRUE,1,1
Signalr SQL backplane causes The wait operation timed out exception,"<p>We have recently implemented the backplane using sql server. The server that we created the backplane contains other databases as well. These other databases are accessed by different applications which are on different servers. For stress testing we implemented a simple signalr client program which sends a message to the server every 30 seconds. There are two servers which are handled by a load balancer. The backplane works perfectly when number of clients are small.</p>

<p>The issue is when the number of clients are higher. (closer to 50 or more). The following exception is thrown by other applications that tries to use the database server for a different database.</p>

<pre><code>System.Data.SqlClient.SqlException: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding. ---&gt; System.ComponentModel.Win32Exception: The wait operation timed out
   --- End of inner exception stack trace ---
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean&amp; dataReady)
   at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
   at System.Data.SqlClient.SqlDataReader.get_MetaData()
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task&amp; task, Boolean asyncWrite, SqlDataReader ds)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task&amp; task, Boolean asyncWrite)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
   at System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext,TResult](TTarget target, Func`3 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed)
   at System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.Reader(DbCommand command, DbCommandInterceptionContext interceptionContext)
   at System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)
   --- End of inner exception stack trace ---
   at System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)
   at System.Data.Entity.Core.Objects.Internal.ObjectQueryExecutionPlan.Execute[TResultType](ObjectContext context, ObjectParameterCollection parameterValues)
   at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess)
   at System.Data.Entity.Core.Objects.ObjectQuery`1.&lt;&gt;c__DisplayClass7.&lt;GetResults&gt;b__5()
   at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute[TResult](Func`1 operation)
   at System.Data.Entity.Core.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)
   at System.Data.Entity.Core.Objects.ObjectQuery`1.&lt;System.Collections.Generic.IEnumerable&lt;T&gt;.GetEnumerator&gt;b__0()
   at System.Data.Entity.Internal.LazyEnumerator`1.MoveNext()
   at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source)
   at System.Linq.Queryable.Count[TSource](IQueryable`1 source)
</code></pre>

<p>Because of this exception all the other applications breaks since they can not access the database. The problem immidiately fixes if we disable the backplane. (stopping the two signalr servers). Is this the expected behavior when using the backplane with high number of users or is it an issue with the backplane?  </p>

<p>PS - We noticed that the machines that throw these exceptions have more than 3000 threads allocated for w3wp.exe process. Seems like they are stuck on a operation. </p>

<p><a href=""https://i.stack.imgur.com/Bo4uD.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/Bo4uD.png"" alt=""enter image description here""></a></p>

<p><a href=""https://i.stack.imgur.com/AMgwc.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/AMgwc.png"" alt=""enter image description here""></a></p>
",https://stackoverflow.com/questions/43758004/signalr-sql-backplane-causes-the-wait-operation-timed-out-exception,"['c#', 'sql', 'asp.net', 'signalr', 'signalr-backplane']",578,TRUE,2,1
What are the physical limits of JMeter?,"<p>I'm working on a web application written in PHP which will be used by millions of visitors which can create many hits from different IP addresses all at the same time.  Potentially many thousands of hits in the same second is a very real possibility with this particular application.  Optimization is out of the question in regards to that fact.</p>

<p>That said, I've been doing some research into JMeter for stress testing.  My understanding is this uses multithreading to simulate many http requests (or other types of requests) to a designated server.</p>

<p>My thinking then is that you can only do so many parallel requests at once on a computer with a tool such as this, and I'm worried if I invest the time into learning JMeter further that it will not be enough of an accurate test for the website/service when it goes live.</p>

<p>That said after some looking around and not finding the answer, what are the physical limits of testing for JMeter? What kind of load can it accurately test? Are there alternatives to JMeter (like Grinder), or a service (paid or free) that simulates many different IP Addresses connecting to a server to test?</p>
",https://stackoverflow.com/questions/45092742/what-are-the-physical-limits-of-jmeter,"['php', 'multithreading', 'jmeter', 'load-testing', 'stress-testing']",242,TRUE,0,1
Action to spawn multiple further actions in Gatling scenario,"<h1>Background</h1>

<p>I'm currently working on a capability analysis set of stress-testing tools for which I'm using gatling.</p>

<p>Part of this involves loading up an elasticsearch with scroll queries followed by update API calls.</p>

<h1>What I want to achieve</h1>

<p><strong>Step 1:</strong> Run the scroll initiator and save the <code>_scroll_id</code> where it can be used by further scroll queries<br /></p>

<p><strong>Step 2:</strong> Run a scroll query on repeat, as part of each scroll query make a modification to each hit returned and index it back into elasticsearch, effectively spawning up to 1000 Actions from the one scroll query action, and having the results sampled.</p>

<p>Step 1 is easy. Step 2 not so much.</p>

<h1>What I've tried</h1>

<p>I'm currently trying to achieve this via a ResponseTransformer that parses JSON-formatted results, makes modifications to each one and fires off a thread for each one that attempts another <code>exec(http(...).post(...) etc)</code> to index the changes back into elasticsearch.</p>

<p>Basically, I think I'm going about it the wrong way about it. The indexing threads never get run, let alone sampled by gatling.</p>

<p>Here's the main body of my scroll query action:</p>

<pre><code>  ...

  val pool = Executors.newFixedThreadPool(parallelism)

  val query = exec(http(""Scroll Query"")
    .get(s""/_search/scroll"")
    .body(ElFileBody(""queries/scrollquery.json"")).asJSON // Do the scroll query
    .check(jsonPath(""$._scroll_id"").saveAs(""scroll_id"")) // Get the scroll ID from the response
    .transformResponse { case response if response.isReceived =&gt;
      new ResponseWrapper(response) {
        val responseJson = JSON.parseFull(response.body.string)
        // Get the hits and
        val hits = responseJson.get.asInstanceOf[Map[String, Any]](""hits"").asInstanceOf[Map[String,Any]](""hits"").asInstanceOf[List[Map[String, Any]]]
        for (hit &lt;- hits) {
          val id = hit.get(""_id"").get.asInstanceOf[String]
          val immutableSource = hit.get(""_source"").get.asInstanceOf[Map[String, Any]]
          val source = collection.mutable.Map(immutableSource.toSeq: _*) // Make the map mutable
          source(""newfield"") = ""testvalue"" // Make a modification
          Thread.sleep(pause) // Pause to simulate topology throughput
          pool.execute(new DocumentIndexer(index, doctype, id, source)) // Create a new thread that executes the index request
        }
      }
    }) // Make some mods and re-index into elasticsearch

  ...
</code></pre>

<p>DocumentIndexer looks like this:</p>

<pre><code>class DocumentIndexer(index: String, doctype: String, id: String, source: scala.collection.mutable.Map[String, Any]) extends Runnable {

  ...

  val httpConf = http
    .baseURL(s""http://$host:$port/${index}/${doctype}/${id}"")
    .acceptHeader(""application/json"")
    .doNotTrackHeader(""1"")
    .disableWarmUp

  override def run() {

    val json = new ObjectMapper().writeValueAsString(source)

    exec(http(s""Index ${id}"")
      .post(""/_update"")
      .body(StringBody(json)).asJSON)

  }

}
</code></pre>

<h1>Questions</h1>

<ol>
<li>Is this even possible using gatling?</li>
<li>How can I achieve what I want to achieve?</li>
</ol>

<p>Thanks for any help/suggestions!</p>
",https://stackoverflow.com/questions/42415360/action-to-spawn-multiple-further-actions-in-gatling-scenario,"['gatling', 'stress-testing']",693,TRUE,2,1
"Extremely high latency when network gets busy, TCP, libevent","<p>In our C/S based online game project, we use TCP for network transmission. We include <strong>Libevent</strong>, utilise a bufferevent for each connection to handling with the network I/O automatically.  </p>

<p>It works well before，but the lagging problem comes to the surface recently. When I do some stress testing to make the network busier, the latency becomes extremely high, several seconds or more. The server sinks into a confusing state: </p>

<ul>
<li>the average CPU usage decreased (0%-60%-0%-60% repeat, waiting something?)</li>
<li>the net traffic decreased (nethogs)</li>
<li>the clients connected to server still alive (netstat &amp; tcpdump)</li>
</ul>

<p>It looks like something magically slowed all system down, but new connection to server responded quit in time.  </p>

<p>When I changed the protocol to UDP, it works well on the same situation: no obvious latency, the system runs fast. Net traffic is around 3M/S.</p>

<p>The project is running on an Intranet. I also tested the max download speed, nearly 18M/S.</p>

<p>I studied part of Libevent's header files and ducumentations, tried to setup a rate limit to all connections. It did some improvements, but not completely resolved the problem even though I had tried several different configurations. Here is my parameters: read_rate 163840, read_burst 163840, write_rate 163840, write_burst 163840, tick_len 500ms.</p>

<p>Thank you for your help!</p>
",https://stackoverflow.com/questions/41595970/extremely-high-latency-when-network-gets-busy-tcp-libevent,"['networking', 'tcp', 'server', 'latency', 'libevent']",771,TRUE,0,1
JMeter: each sampler is taking 100 ms,"<p>Im using JMeter for stress testing. Im sending requests in a continuous loop. Actually Latency / Elapsed time shows only 10 ms., but JMeter is not executing the next sampler for another 100 - 120 ms., which is resulting in a delay.<br>
  I really wonder if each sampler takes so much time for preparing to be executed.  Also, generally pre and post processor dont get logged into results csv., so the sample elapsed time included their execution time as well?<br>
  Appreciate the help  </p>

<h1>Test Plan</h1>

<blockquote>
  <p>TestPlan  </p>
  
  <blockquote>
    <p>Setup Thread Group
    Thread Group 1  </p>
    
    <blockquote>
      <p>Random Variable<br>
      User Defined vars<br>
      Loop1  </p>
      
      <blockquote>
        <p>Http Request1  </p>
        
        <blockquote>
          <p>Header Manager<br>
          Post Processor (My Own, it really improved performance compared to BeanShell / JSR223)  </p>
        </blockquote>
        
        <p>Http Request2  </p>
        
        <blockquote>
          <p>Header Manager  </p>
        </blockquote>
        
        <p>Constant Time wait (50ms)  </p>
      </blockquote>
      
      <p>Loop2  </p>
      
      <blockquote>
        <p>Http Request1  </p>
        
        <blockquote>
          <p>Header Manager<br>
          Post Processor (My Own)  </p>
        </blockquote>
        
        <p>Http Request2  </p>
        
        <blockquote>
          <p>Header Manager<br>
          Constant Time wait (10ms)  </p>
        </blockquote>
      </blockquote>
    </blockquote>
    
    <p>Thread Group 2  #not used at the moment<br>
    Thread Group 3  #not used at the moment<br>
    Teardown Thread Group  </p>
  </blockquote>
</blockquote>

<p>In the Above plan., there is no sleep or anything between HTTP Request 1 &amp; 2., still it is taking 115ms
Thought there is a wait after HTTP Request2 in each loop it is just 10 ms, here it is taking 125 ms. </p>

<p>Thanks,
Rao</p>
",https://stackoverflow.com/questions/42484331/jmeter-each-sampler-is-taking-100-ms,"['jmeter', 'jmeter-plugins']",208,TRUE,0,1
Why such an overhead for system with docker containers usage?,"<p>I have a following question. I was designing recently a java application on Spring, that works with a database. And I have decided to perform a stress testing. Both the application and the database reside on a virtual Debian machine. I tested it with gatling, and here is what I got:</p>

<blockquote>
  <p>request count                                        600 (OK=600    KO=0     )</p>
  
  <p>min response time                                     12 (OK=12     KO=-     )</p>
  
  <p>max response time                                    159 (OK=159    KO=-     )</p>
  
  <p>mean response time                                    21 (OK=21     KO=-     )</p>
  
  <p>std deviation                                         13 (OK=13     KO=-     )</p>
  
  <p>response time 50th percentile                         17 (OK=17     KO=-     )</p>
  
  <p>response time 75th percentile                         22 (OK=22     KO=-     )</p>
  
  <p>mean requests/sec                                  10.01 (OK=10.01  KO=-     )</p>
  
  <p>t &lt; 800 ms                                           600 (100%)</p>
  
  <p>800 ms &lt; t &lt; 5000 ms                                   0 (  0%)</p>
  
  <p>t > 5000 ms                                            0 (  0%)</p>
  
  <p>failed                                                 0 (  0%)</p>
</blockquote>

<p>So far, so good. Ater that, I decided to put the database and jar into two containers. Here is a docker-compose.yml sample for that:</p>

<pre><code>  prototype-db:
    build: prototype-db
    volumes:
       - ./prototype-db/data:/var/lib/mysql:rw
       - ./prototype-db/scripts:/docker-entrypoint-initdb.d:ro
    ports:
       - ""3306""
  prototype:
    image: openjdk:8
    command: bash -c ""cd /deploy &amp;&amp; java -jar application.jar"" 
    volumes:
      - ./application/target:/deploy
    depends_on:
      - prototype-db
    ports:
      - ""8080:8080""
    dns:
      - 172.16.10.1
      - 172.16.10.2
</code></pre>

<p>The Dockerfile looks like this:</p>

<pre><code>FROM mysql:5.7.15

ENV MYSQL_DATABASE=document \
    MYSQL_ROOT_PASSWORD=root \
    MYSQL_USER=testuser \
    MYSQL_PASSWORD=12345

EXPOSE 3306
</code></pre>

<p>Now, after testing that with gatling I've got the followin results:</p>

<p>---- Global Information --------------------------------------------------------</p>

<pre><code>request count 6000 (OK=3946 KO=2054 )
min response time 0 (OK=124 KO=0 )
max response time 18336 (OK=18336 KO=77 )
mean response time 5021 (OK=7630 KO=10 )
std deviation 4136 (OK=2478 KO=9 )
response time 50th percentile 6516 (OK=8694 KO=9 )
response time 75th percentile 8732 (OK=8905 KO=14 )
mean requests/sec 87.433 (OK=57.502 KO=29.931)
</code></pre>

<p>---- Response Time Distribution ------------------------------------------------</p>

<pre><code>t &lt; 800 ms 65 ( 1%)
800 ms &lt; t &lt; 5000 ms 532 ( 9%)
t &gt; 5000 ms 3349 ( 56%)
failed 2054 ( 34%)
</code></pre>

<p>---- Errors --------------------------------------------------------------------</p>

<pre><code>java.io.IOException: Remotely closed 1494 (72.74%)
status.find.is(200), but actually found 500 560 (27.26%)
</code></pre>

<p>This is amazing - the mean response time exceeded drastically, and a lot of errors, but this docker compose system runs on the very same virtual debian machine. What could cause exactly such an overhead, I thought that docker containers are a lot like native processed, they should not be running that slow.</p>
",https://stackoverflow.com/questions/42508035/why-such-an-overhead-for-system-with-docker-containers-usage,"['docker', 'docker-compose']",82,FALSE,1,0
Angular 2/4 Routing: Does it perform like a native mobile app or do I need to resolve states?,"<p>I just want to keep things simple - how is Angular 2/4 resolving previous components data state in my application without any routing resolves implemented? I am using the recommended Angular setup (CLI ^4.2.4) </p>

<p>Here is the scenario</p>

<p>1) Navigate to a route view that fires up view specific components that do some API requests for data and show items<br/><br/>
2) Click on an item and go to a different view using different components that also do API requests for data<br/><br/>
3) Click back on the browser and the previous view is displayed (Although through stress testing and using different IDE's it is not always consistent..which worries me)<br/><br/></p>

<p>Is the previous state of the components saved in the browsers cache/heap or does the Angular framework perform some kind of magic to accomplish this?
I am aware that in a native mobile app, previous views are just layers that never actually ""go away"". When a new view is selected, the old one is still there in the background. Or do I have that wrong?</p>

<p>On my last project I used a view resolver to get data for the previous view. It took time to implement, but it worked flawless. I am curious to see if using resolves for future projects is a sound decision or just overkill and actually losing performance features of new Angular</p>
",https://stackoverflow.com/questions/47355008/angular-2-4-routing-does-it-perform-like-a-native-mobile-app-or-do-i-need-to-re,"['javascript', 'android', 'angular', 'performance', 'architecture']",64,TRUE,0,1
File read performance test yields interesting results. Possible explanations?,"<p>I'm stress-testing my system to determine just how much punishment the filesystem can take. One test involves repeated reads on a single small (thus presumably heavily cached) file to determine overhead.</p>

<p>The following python 3.6.0 script generates two lists of results:</p>

<pre><code>import random, string, time

stri = bytes(''.join(random.choice(string.ascii_lowercase) for i in range(100000)), 'latin-1')

inf = open('bench.txt', 'w+b')
inf.write(stri)

for t in range(0,700,5):
    readl = b''
    start = time.perf_counter()
    for i in range(t*10):
        inf.seek(0)
        readl += inf.read(200)
    print(t/10.0, time.perf_counter()-start)

print()

for t in range(0,700,5):
    readl = b''
    start = time.perf_counter()
    for i in range(3000):
        inf.seek(0)
        readl += inf.read(t)
    print(t/10.0, time.perf_counter()-start)

inf.close()
</code></pre>

<p>When plotted i get the following graph:</p>

<p><img src=""https://i.imgur.com/Py8I58x.png"" alt=""Results graph""></p>

<p>I find these results very weird. The second test (blue in the picture, mutable read lenght parameter) starts off linearly increasing which is expected, then after a point it decides to climb much more quickly. Even more surprisingly, the first test (pink, mutable repetitions count and fixed read length) also shows the wild departure which is interesting because the size of the read function remains fixed there. It's also very irregular which is head-scratching at best. My system was idle when running the tests.</p>

<p>What plausible reason could there be that causes such a major performance degradation after a certain number of repetitions?</p>

<p><strong>EDIT:</strong></p>

<p>The fact that <code>readl</code> is a byte array apparently is a major performance hog. Switching it to a string drastically improves everything. Yet even when working with strings, calling the read and seek functions is a minor factor by comparison. Here are more test variants of test 1 (mutable repetitions). Test 2 is left out because its results turn out to be entirely explained by the byte array performance difference alone:</p>

<pre><code>import random, string, time

strs = ''.join(random.choice(string.ascii_lowercase) for i in range(100000))
strb = bytes(strs, 'latin-1')

inf = open('bench.txt', 'w+b')
inf.write(strb)

#bytes and read
for t in range(0,700,5):
    readl = b''
    start = time.perf_counter()
    for i in range(t*10):
        inf.seek(0)
        readl += inf.read(200)
    print(t/10.0, '%f' % (time.perf_counter()-start))
print()

#bytes no read
for t in range(0,700,5):
    readl = b''
    start = time.perf_counter()
    for i in range(t*10):
        readl += strb[0:200]
    print(t/10.0, '%f' % (time.perf_counter()-start))
print()

#string and read
for t in range(0,700,5):
    readl = ''
    start = time.perf_counter()
    for i in range(t*10):
        inf.seek(0)
        readl += inf.read(200).decode('latin-1')
    print(t/10.0, '%f' % (time.perf_counter()-start))
print()

#string no read
for t in range(0,700,5):
    readl = ''
    start = time.perf_counter()
    for i in range(t*10):
        readl += strs[0:200]
    print(t/10.0, '%f' % (time.perf_counter()-start))
print()

inf.close()
</code></pre>

<p><img src=""https://i.imgur.com/w19DdVC.png"" alt=""Results graph""></p>
",https://stackoverflow.com/questions/45311204/file-read-performance-test-yields-interesting-results-possible-explanations,"['python', 'windows', 'python-3.x', 'file-io', 'windows-7']",91,FALSE,0,0
In Jmeter Execute a sample request only once irrespective of thread count,"<p>I am stress testing application database.
I have successfully setup JDBC connection configuration and able to execute queries.
The requirement is: 
Insert new customers in customer_table in a database. Customer ID(which is a column name) should be unique and in sequential order. For e.g, In customer_table if 100 customers already exists then to add other customers the customer_id should begin with 101.
So, In my test plan I need to first fetch the number of existing customers using Select query and then execute actual Insert query which is to be stress tested.
So, I have added following to my test plan.</p>

<ol>
<li>A jdbc request with select query to get number of existing customers.(Only once in whole test plan) and save the number of customers in a variable name.</li>
<li>A Counter element, where start value will be the variable name from first jdbc request and increment it by one.</li>
<li>Actual JDBC request with insert query.</li>
</ol>

<p>The problem with this approach is I need to execute the First request only once, irrespective of the number of thread count.
Alternative approach I tried:
I also tried creating two thread groups and passing the number of customer from first thread group to second thread group using Jmeter properties. But the second thread group is not able to access the customer count from first thread group which I have set as Jmeter property.
Any help in appreciated.</p>
",https://stackoverflow.com/questions/44519050/in-jmeter-execute-a-sample-request-only-once-irrespective-of-thread-count,"['jmeter', 'performance-testing', 'database-performance', 'jmeter-plugins']",1940,TRUE,1,1
How many concurrent request does the websphere application server process (WAS 8.0)?,"<p>We have the IBM HTTP Server in front of our App Server.
We run around 50 concurrent request during stress testing.
But we are getting errors and are not able to run 50 concurrent request.
The server runs successfully for 40 concurrent request. The memory and cpu utilization have not peaked, there are enough resources to handle requests.But 
we are not able to find any request in the app server log.
But in plugin logs we are able to see the request.
The following are the configurations.</p>

<p>From IBM site, my understanding is IHS server will be able to process 600 concurrent request by default and there are 50 threads to process by default  in App Server.</p>

<p>From the logs seen, in plugin , i infer that the requests are processed by the ihs server, but the threads available in app server( 50 by default) is not enough to process 50 concurrent request. Is there a one to one mapping between the threads and the concurrent request? Do we need to increase the maximum threads. What are the parameters that need to be modified to increase the concurrent request with respect to IHS, Websphere app server and the plugin conf to increase the concurrent request handling of the websphere 8.0</p>

<p><strong>httpd.conf:</strong>
<strong># Windows MPM</strong>

ThreadLimit         2048
ThreadsPerChild     250
MaxRequestsPerChild  0
</p>

<p><strong>plugin.conf</strong></p>

<pre><code>&lt;ServerCluster CloneSeparatorChange=""false"" GetDWLMTable=""false"" IgnoreAffinityRequests=""true"" LoadBalance=""Round Robin"" Name=""xxxx"" PostBufferSize=""64"" PostSizeLimit=""-1"" RemoveSpecialHeaders=""true"" RetryInterval=""60"" ServerIOTimeoutRetry=""-1""&gt;
      &lt;Server ConnectTimeout=""0"" ExtendedHandshake=""false"" MaxConnections=""-1"" Name=""xxxx"" ServerIOTimeout=""900"" WaitForContinue=""false""&gt;
         &lt;Transport Hostname=""SA16"" Port=""9080"" Protocol=""http""/&gt;
          &lt;/Server&gt;
   &lt;/ServerCluster&gt;
</code></pre>

<p><strong>WebContainer Settings in app server</strong>
<strong><em>(Application servers > server1 > Thread pools > WebContainer)</em></strong>
   Minimum thread - 50
   Maximum thread - 50</p>
",https://stackoverflow.com/questions/47571101/how-many-concurrent-request-does-the-websphere-application-server-process-was-8,"['java', 'multithreading', 'concurrency', 'websphere']",3177,TRUE,0,1
Incorrect return address is POPed after SVC call,"<p>I am working on an ARM Cortex-A5 core of a custom processor and getting a really weird issue which seem to be unexplainable from the SW point of view.
 The issue is that at some point when <em>stress-testing</em> the system (rebooting hundreds of times), sometimes a Prefetch abort is happening when returning from some SVC call. The calls are implemented as following: </p>

<p>User mode code:</p>

<pre><code>;...Stuff
    BL       foo
;.. Stuff.

foo
    PUSH     {r4,lr}
    SVC      #0x1a 
    POP      {r4,pc}
</code></pre>

<p>SVC handler:</p>

<pre><code>SVC_Handler
    PUSH     {r0-r12,lr}
    ;... Do stuff
    POP      {r0-r12,lr}
    SUBS     pc,lr,#0
</code></pre>

<p>When the abort is happening, the <code>LR_USR</code> is pointing to the instruction next to <code>BL foo</code>, but <code>IFAR</code> has a value of zero as well as <code>r4</code>. So is <code>LR_ABT</code> has a value of <code>0x4</code>, which makes sense if we tried to branch to the address zero. Given these observations it looks like the <code>POP {r4,pc}</code> instruction is fetching two zeros from the stack instead of the correct values, <strong>which are in the stack at the correct positions</strong> as observed with the debugger <strong>after</strong> the abort is hit (they are two words above the <code>SP_USR</code>). So it looks like either the stack is updated with the correct values <em>after</em> the pop instruction is happening, or the <code>POP</code> instruction is just buggy.</p>

<p>It worth noting that the code and the stack are in a cacheable memory. User mode and SVC mode have distinct stacks.</p>

<p>Can this effect be explained from the SW point of view or it is likely a hardware bug (memory/cache controller?). Have anyone seen something similar in their career? Unfortunately it is possible to debug only <em>post-mortem</em>. And instrumenting the code is shifting the bug away to another call (Yes, it is Heisenbug...) </p>
",https://stackoverflow.com/questions/43946734/incorrect-return-address-is-poped-after-svc-call,"['assembly', 'arm', 'stack', 'abort', 'cortex-a']",140,FALSE,4,0
AppActivate to Close Window not Looping,"<p>I have an application that often needs to be run without actively being monitored but, if it encounters an error, it will pop-up a message window and pause until a user has pressed close. It's causing a lot of problems at the moment as we're stress testing and cannot disable these messages, so someone has to constantly keep on eye on the process. I've been trying to come up with some VBScript that will keep checking for the pop-up message and automatically close it, using the <code>AppActivate</code> and <code>SendKeys</code> functions.</p>

<p>The problem is I need this to work within a GUI so the user can easily start/stop the code from running at the click of a button. I currently therefore have my VBScript wrapped in an HTA application with a single button, but for some reason it will only ever close the first instance of the message (multiple can be loaded simultaneously) and then stops.</p>

<pre class=""lang-vb prettyprint-override""><code>Sub Testing
    Set objShell = CreateObject(""WScript.Shell"")
    counter = 1
    Do While counter &lt; 50
        ret = objShell.AppActivate(""Test Failure"")
        counter = counter + 1
        If ret = True Then
            objShell.SendKeys ""~""
        End If
    Loop
End Sub
</code></pre>

<p>With a button as follows:</p>

<pre class=""lang-html prettyprint-override""><code>&lt;input type=""button"" value=""Run Script"" name=""run_button"" onClick=""Testing""&gt;&lt;p&gt;
</code></pre>

<p>I need it to just constantly run in the background, only executing the <code>SendKeys</code> if the ""Test Failure"" window is selected/present and be able to stop the loop when a second button is pressed.</p>

<p>I'm clearly getting something wrong (VBScript does execute top to bottom, does it not?) and I've never really played around with these functions before, but it all seems to be setup correctly.</p>

<hr>

<p>I've marked @Ansgar Wiechers answer as correct as it solved the root cause of my issue. The final code I ended up with was in two parts. The application:</p>

<pre><code>&lt;!doctype html&gt;
&lt;head&gt;
&lt;hta:application
    id=""AutoCloseFailures""
    applicationname=""AutoCloseFailures""
    icon=""""
    singleinstance=""yes""
    border=""thick""
    borderstyle=""complex""
    scroll=""no""
    maximizebutton=""no""
    version=""0.1"" /&gt;
&lt;title&gt;Auto-Close Failure Messages&lt;/title&gt;
&lt;meta http-equiv=""x-ua-compatible"" content=""ie=8""&gt;
&lt;meta http-equiv=""Content-Type"" content=""text/html; charset=utf-8""&gt;
&lt;/head&gt;
&lt;script language=""VBScript""&gt;

    ' Set Global Variables for Subroutines
    script = ""#FOLDERPATH#\AutoCloseDEFXErrorsTimer.vbs""
    Set sh  = CreateObject(""WScript.Shell"")
    Set cmdTest = Nothing
    strVar = ""testing2""

    Sub StartLoop
    ' Initiate VB Loop to Target Failure Windows &amp; Close Them
        If cmdTest Is Nothing Then
            Set cmdTest = sh.Exec(""wscript.exe """""" &amp; script &amp; """""""")
            strVar = ""testing""
        End If
        document.all.start.style.background=""#777d84""
        document.all.start.style.color=""#bfc4c9""
    End Sub

    Sub StopLoop
    ' Terminate VB Loop Process &amp; Reset Application
        strScriptToKill = ""AutoCloseDEFXErrorsTimer.vbs""
        Set objWMIService = GetObject(""winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2"")
        Set colProcess = objWMIService.ExecQuery ( _
            ""Select * from Win32_Process "" &amp; _
            ""WHERE (Name = 'cscript.exe' OR Name = 'wscript.exe') "" &amp; _
            ""AND Commandline LIKE '%""&amp; strScriptToKill &amp;""%'"" _
        )
        For Each objProcess in colProcess
            objProcess.Terminate()
        Next
        Set cmdTest = Nothing
        document.all.start.style.background=""#587286""
        document.all.start.style.color=""#ffffff""
    End Sub

    Sub Window_onLoad
    ' Force Window Size
        window.resizeTo 400,190
        window.moveTo 1530, 0
    End Sub
&lt;/script&gt;
&lt;style&gt;
    body {
        margin: 0;
        padding: 0;
        font-family: ""Segoe UI"", Geneva, sans-serif;
        background: #dae3f2;
    }
    h1 {
        font-size: 15pt;
        text-align: center;
        margin-bottom: 0;
        color: #273754;
    }
    button {
        padding:16px 32px;
        font-family:helvetica;
        font-size:16px;
        font-weight:100;
        color:#fff;
        background: #587286;
        border:0;
    }
    button:hover {
        background: #3B5C76;
    }
    .container {
        width: 100%;
        text-align: center;
    }
&lt;/style&gt;
&lt;BODY&gt;
    &lt;h1&gt;Auto-Close Failure Messages&lt;/h1&gt;
    &lt;br&gt;
        &lt;div class=""container""&gt;
            &lt;button id=""start"" onclick=""StartLoop""&gt;Start&lt;/button&gt;
            &lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;
            &lt;button id=""stop"" onclick=""StopLoop""&gt;Stop&lt;/button&gt;
        &lt;/div&gt;
    &lt;br&gt;
&lt;/BODY&gt;
&lt;/HTML&gt;
</code></pre>

<p>And the supporting vbScript file:</p>

<pre><code>Set sh = CreateObject(""WScript.Shell"")
While True
    active = sh.AppActivate(""#WINDOW TITLE#"")
    If active Then
        sh.SendKeys ""~""
    End If
    WScript.Sleep 100
Wend
</code></pre>
",https://stackoverflow.com/questions/42411415/appactivate-to-close-window-not-looping,"['vbscript', 'hta']",1466,TRUE,0,1
How to make my Fibonacci with Modular Arithmetic more efficient to find the pisano cycle?,"<p>Due to educational purposes, I am building a code in Python3 in order to accomplish this goal:</p>

<p><a href=""https://i.stack.imgur.com/1rmC1.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/1rmC1.png"" alt=""enter image description here""></a></p>

<p>I think I did a very good job for this problem since I am in a beginner/intermediate level. This problem is an advanced and not obligatory one.</p>

<p>I did stress testing using a slow-but-saffer function as ""control group"". After that, I was able to create a faster function.</p>

<p>However, my implementation is problematic for some <em>pisano cycles</em>.
As you might see in here:
<a href=""http://webspace.ship.edu/msrenault/fibonacci/fiblist.htm"" rel=""nofollow noreferrer"">http://webspace.ship.edu/msrenault/fibonacci/fiblist.htm</a>
 some mods can create huge Pisano periodic-cycles... </p>

<p>My function works really fast for mods like &lt;249... However, I don't know how to deal with mods like 1570, which generates a pattern/cycle with a total length of 4740 numbers... That's the a ciclical pattern involving not 001 our 12113 but 4740 numbers...</p>

<p>I tried searching for a way to solve this. I was able to find different approaches that would solve the problem. Nonetheless, I would like to try fixing my implementation, making it faster on the cycle-recognition part - if this is possible at all....</p>

<p>That's my code.</p>

<pre><code>coursera_input = (input())
coursera_input = (coursera_input.split())
n_in = int(coursera_input[0])
mod_in = int(coursera_input[1])

import random

def my_fibo_iter(x):
    if x&lt;=1:
        return x
    else:
        bef_previous_elem = 0
        previous_elem = 1
        current = 0
        count = 1
        while count&lt;x:
            count = count + 1
            current = bef_previous_elem + previous_elem
            bef_previous_elem = previous_elem
            previous_elem = current
        return (current)

def fibo_iter_mod_slow(n,mod):
    if n==0:
        return n%mod
    elif n==1:
        return n%mod
    else:
        previous = 1%mod
        bef_previous = 0%mod 
        count = 1
        while count&lt;(n):
                current = bef_previous%mod + previous%mod 
                bef_previous = previous%mod 
                previous = current%mod 
                count = count + 1
        return current%mod 

#preciso construir um algoritmo para identificar a pisano period/cycle

def pisano_cycle(big_list):
    promising_list = []
    for i in big_list:
        promising_list.append(i)
        p_l_len = len(promising_list)
        p_l_final_index = 2*p_l_len
        if promising_list == big_list[p_l_len:p_l_final_index]:
            break
    return promising_list

def generate_big_pisano_list(mod):
    big_list = []
    if mod&lt;249:
        limit = 700
    if 249&lt;=mod&lt;1000:
        limit = 3001
    else:
        limit = 6000
    for i in range(0,limit):
        big_list.append(fibo_iter_mod_slow(i,mod))
    return big_list

#agora eu sei gerar uma lista pisano
#sei identificar uma lista de pisano
#preciso de uma outra função
#ela deve, sabendo o padrão CÍCLICO, identificar o nth elemento desse padrão


def fibo_iter_mod_fast(n,mod):
    big_pisano_list = generate_big_pisano_list(mod)
    pattern = pisano_cycle(big_pisano_list)
    length_patt = len(pattern)
    index_analogous = (n%length_patt)
    output_in_mod = pattern[index_analogous]
    return output_in_mod

print (fibo_iter_mod_fast(n_in,mod_in))
</code></pre>

<p>If you input something like:</p>

<pre><code>2816213588 30524
</code></pre>

<p>It gets the correct output:</p>

<pre><code>10249
</code></pre>

<p>But it takes more than 5 seconds...</p>

<p>Another problem that happens is when I have a huge number as an input for the mod, like:</p>

<p>Failed case #12/22: (Wrong answer) </p>

<p>Input: 99999999999999999 100000 </p>

<p>Your output: 69026 </p>

<p>Correct output: 90626 </p>

<p>(Time used: 0.04/5.00, memory used: 24100864/536870912.)</p>

<p>My code returns an incorrect output due to this part:</p>

<pre><code>   def generate_big_pisano_list(mod):
        big_list = []
        if mod&lt;249:
            limit = 700
        if 249&lt;=mod&lt;1000:
            limit = 3001
        else:
            limit = 6000
</code></pre>

<p>I am limiting the range of the pisano cycle in a range of 60000 numbers, and some pisano cycles, apparently, can go really beyond that...</p>
",https://stackoverflow.com/questions/43545634/how-to-make-my-fibonacci-with-modular-arithmetic-more-efficient-to-find-the-pisa,"['algorithm', 'performance', 'python-3.x', 'fibonacci', 'mod']",299,TRUE,1,1
Messenger Platform Limit Error (#613) Calls to this api have exceeded the rate limit,"<p>I'm having trouble stress testing my app with the Messenger Platform to send the same message to several users in a small timeframe. I'm getting a Limit Error: <code>(#613) Calls to this api have exceeded the rate limit.</code></p>
<p>Currently I'm testing this by sending the same message several times to the same user (me); in a real world scenario, the same message would be sent to several different users of course.</p>
<p>Also, I'm using a test application of a live app to perform these tests. Is this supposed to drastically improve in the live app?</p>
<p>I really need a nice throughput broadcasting messages, so currently my setup has several threads spawn (50) sending messages in parallel, some of them already hit this limit and error out.
Also, I tried the Batch Requests to improve the speed of the delivery process, and at that point it really becomes unbearable, with a success rate of less than 50%.</p>
<p>I've read about general Graph API rate limits (<a href=""https://developers.facebook.com/docs/graph-api/advanced/rate-limiting"" rel=""noreferrer"">https://developers.facebook.com/docs/graph-api/advanced/rate-limiting</a>), and to send a message you provide a Page Access Token, so I would expect my app to fall into the &quot;Page-Level Rate Limiting&quot; category, if I was sending too many messages. However, in the error responses there are no X-Page-Usage headers (neither X-App-Usage, by the way).</p>
<p>In the Messenger Platform documentation (<a href=""https://developers.facebook.com/docs/messenger-platform/send-api-reference#limits"" rel=""noreferrer"">https://developers.facebook.com/docs/messenger-platform/send-api-reference#limits</a>) the following is stated:</p>
<blockquote>
<p>Messenger Platform supports a high rate of calls to the Send API.</p>
<p>However, you should architect your system such that you distribute any sudden high amounts of load over time and are able to control your throughput should you hit our rate limits.</p>
<p>Rate limits are in place to prevent malicious behavior and poor user experiences.</p>
<p>Be sure to catch any errors returned by the Send API including the one indicating that you've reached the rate limit.</p>
</blockquote>
<p>These are not particularly helpful either, since they don't explicitly refer to the general Graph API limits neither specify a different amount of requests you're allowed to perform.</p>
<p>Is there anything that I might be missing?</p>
",https://stackoverflow.com/questions/44520716/messenger-platform-limit-error-613-calls-to-this-api-have-exceeded-the-rate-l,"['facebook', 'facebook-graph-api', 'facebook-send-api']",39352,TRUE,7,2
weird phenomena during deadlocks involving IMAGE or TEXT columns,"<p>This is something very disturbing I stumbled upon while stress-testing an application using Sybase ASE 15.7.</p>

<p>We have the following table:</p>

<pre><code>CREATE TABLE foo
(
    i INT NOT NULL,
    blob  IMAGE    
);
ALTER TABLE foo ADD PRIMARY KEY (i);
</code></pre>

<p>The table has, even before starting the test, a <b>single</b> row with some data in the IMAGE column. <b>No</b> rows are either deleted or inserted during the test. So the table always contains a single row. Column <em>blob</em> is only updated (in transaction <b>T1</b> below) to some value (not NULL).</p>

<p>Then, we have the following two transactions:</p>

<pre><code>T1: UPDATE foo SET blob=&lt;some not null value&gt; WHERE i=1
T2: SELECT * FROM foo WHERE i=1
</code></pre>

<p>For some reason, the above transactions may deadlock under load (approx. 10 threads doing <b>T1</b> 20 times in a loop and another 10 threads doing <b>T2</b> 20 times in loop).</p>

<p>This is already weird enough, but there's more to come. <b>T1</b> is always chosen as the deadlock victim. So, the application logic, on the event of a deadlock (error code 1205) simply retries <b>T1</b>. This should work and should normally be the end of the story. However &hellip;</p>

<p>&hellip; it happens that sometimes <b>T2</b> will retrieve a row in which the value of the <em>blob</em> column is NULL! This is even though the table already starts with a row and the updates simply reset the previous (non-<em>NULL</em>) value to some other (non-<em>NULL</em>) value. This is 100% reproducible in every test run.</p>

<p>This is observed with the READ COMMITTED serialization level.</p>

<p>I verified that the above behavior also occurs with the <em>TEXT</em> column type but not with <em>VARCHAR</em>.</p>

<p>I've also verified that obtaining an exlusive lock on table <i>foo</i> in transaction <b>T1</b> makes the issue go away.</p>

<p>So I'd like to understand how can something that so fundamentally breaks transaction isolation be even possible? In fact, I think this is worse than transaction isolation as <b>T1</b> never sets the value of the <em>blob</em> column to <em>NULL</em>.</p>

<p><strike>
The test code is written in Java using the <b>jconn4.jar</b> driver (class <b>com.sybase.jdbc4.jdbc.SybDriver</b>) so I don't rule out that this may be a JDBC driver bug.
</strike></p>

<h1>update</h1>

<p>This is reproducible simply using <b>isql</b> and spawning several shells in parallel that continuously execute <b>T1</b> in a loop. So I am removing the <em>Java</em> and <em>JDBC</em> tags as this is definitely server-related.</p>
",https://stackoverflow.com/questions/47083209/weird-phenomena-during-deadlocks-involving-image-or-text-columns,"['sybase', 'sap-ase', 'sybase-ase15']",155,FALSE,0,2
Is there something unstable about 38400 baud?,"<p>I am writing a python project to control a device with PyVisa over a USB cable. I am having a lot of success. I noticed that the device datasheet supported 9600, 19200, 38400, 57600, 115200, 230400, 460800 baud rates so I created some functions for changing the baud rate.</p>

<p>But I wanted a nifty way to detect which baud rate the device is set to so I can automatically connect to it without magically knowing what baud the device is on. The device ""remembers"" the last baud you set it to - it does not reset to a default baud on power loss. The device seems like it doesn't respond at all if you have the wrong baud rate set. So, given a random baud rate, I cycle through all the supported ones and send a short command. If the device answers, THAT'S the baud rate currently set and I use that to talk to the device more.</p>

<p>However, during stress testing I noticed that when the device was randomly set on 38400 baud and I went to detect it, my program would fail to detect that baud rate. (The device wouldn't answer a call on this baud.) When I removed it from the list of supported bauds, the device worked fine.</p>

<p>Is there something about 38400 baud rate that makes it more unstable than other bauds?</p>

<p>I also thought that this use-case was interesting. If you are having problems like this, try dropping support for certain bauds and see if that fixes your errors. Hope it helps.</p>

<p>EDIT: The code really doesn't matter but there was a request for it so...</p>

<pre><code>import visa
BAUDRATES = [
    9600,
    19200,
    38400,
    57600,
    115200,
    230400,
    460800,
]
rm = visa.ResourceManager('@py')
dev = rm.open_resource('ASRLCOM7:INSTR')
for i in range(1, 101): # run 100 tests
    # select a random baud rate from the list
    rand_baud = BAUDRATES[randrange(0,len(BAUDRATES))]
    dev.write('SETBAUD' + str(rand_baud)) # Device response with 'OK'
    print('The random baud was {0}'.format(rand_baud))

# now detect the random baud by sending commands to the instrument and looking for a response
detected_baud = None
for baudrate in BAUDRATES:
    dev.baud_rate = baudrate # sets the com port baud rate
    resp = dev.query('GETINFO')
    if resp != '':
        detected_baud = baudrate
        break
print('The detected baud was {0}'.format(detected_baud))
</code></pre>

<p>This code is abbreviated from the real code but the idea is the same. Just loop through, send a command, and listen for a response. The instrument will not send a response over the com port if a message is sent with the incorrect baud or the command is unintelligible. This detection method ALWAYS failed on 38400 and never fails on any other baud rate. The only way in which this method can fail is that it never receives a response on ANY baud, which is exactly what it was doing. This makes me think maybe there is a clock mismatch only at that baud rate or similar. I was curious to know if certain bauds have higher rate of errors than others.</p>
",https://stackoverflow.com/questions/42772898/is-there-something-unstable-about-38400-baud,"['python', 'python-3.x', 'baud-rate', 'pyvisa']",1431,TRUE,0,1
Designing an ngrx store for scale,"<p>This question is regarding designing ngrx stores.</p>

<p>I have a type of station and substation. when a substation is expanded in the main screen I show its substations and ONLY one station can be expanded at a time.</p>

<p>So thinking of that I make my app state like</p>

<pre><code>export interface AppState {
  public stations: { [id: string] : Station };
  public selectedStation: string;
  public substations: { [id: string] : SubStation };
}
</code></pre>

<p>So basically each time the selectedStation is changed so does the substations via a load action that resets the data from indexeddb.
BUT then I get a requirement to move a Substation to ANOTHER Station which requires to load the target Station's Substations; Now the easier thing to do is add in</p>

<pre><code>public targetSubstations: { [id: string] : SubStation };
</code></pre>

<p>but this seems incorrect and does not seem to scale well, what if I need to load 4 sets of substations? Then do I keep adding <code>targetSubstations1...4</code>?</p>

<p>So an alternative I thought of was</p>

<pre><code>type SubstationHierarchy = {
  [stationId: string]: {
    [substationId: string]: Substation
  }
}
public substations: SubstationHierarchy;
</code></pre>

<p>This seems to scale well but my concern here is that WHILE we don't need to load all substations per stations at once this will be done when a user expands a new Station each time. So the hierarchy will ONLY grow and not be scaled down.</p>

<p>Keeping in mind that I haven't done any proper stress testing of how much memory can be used up by the ngrx store and am developing for the mobile what would be the most recommended approach in designing a store.</p>

<p><strong><em>Edit</em></strong></p>

<p>So we use pouchdb to asynchronously sync the data to indexeddb, you can think of this like a websocket to indexeddb connection.</p>

<p>For INITIAL requirements
One Station has many substations.
A user can only view one Station (and it's substations) at a time in the MAIN screen</p>

<p>Based on this I structure my AppState like this</p>

<pre><code>export interface AppState {
  public stations: { [id: string] : Station };
  public selectedStation: string;
  public substations: { [id: string] : SubStation };
}
</code></pre>

<p>Where each time the selectedStation is changed I also change substations for THAT station. This works fine for most cases.</p>

<p>The issue comes when a user loads a separate screen (not the main screen, let's say a modal) in which he can move a substation from the <code>selectedStation</code> to a target station.</p>

<p>So I could change my appstate to</p>

<pre><code>export interface AppState {
  public stations: { [id: string] : Station };
  public selectedStation: string;
  public substations: { [id: string] : SubStation };
  public targetStation: string;
  public targetSubstations: { [id: string] : SubStation };
}
</code></pre>

<p>now what if I need to allow the substation to be COPIED to TWO seperate targets, this would require me doing something along the lines of</p>

<pre><code>export interface AppState {
  public stations: { [id: string] : Station };
  public selectedStation: string;
  public substations: { [id: string] : SubStation };
  public target1Station: string;
  public target1Substations: { [id: string] : SubStation };
  public target2Station: string;
  public target2Substations: { [id: string] : SubStation };
}
</code></pre>

<p>One option I thought of was structuring <code>substations</code> like this</p>

<pre><code>type SubstationHierarchy = {
  [stationId: string]: {
    [substationId: string]: Substation
  }
}

export interface AppState {
  public stations: { [id: string] : Station };
  public selectedStation: string;
  public substations: SubstationHierarchy;
}
</code></pre>

<p>Where I can now store multiple substations for multiple stations. The only issue is that I am developing for mobile, and the PREVIOUS method of having target1, target2 would result in less of a memory footprint AS I replace substations, target1Substations... each time a different station is clicked, etc. However in the new structure I do not delete any data in the substations hierarchy.</p>
",https://stackoverflow.com/questions/42089715/designing-an-ngrx-store-for-scale,"['javascript', 'angular', 'redux', 'rxjs', 'ngrx']",694,FALSE,3,1
C# tcp async listener gets stuck on my on_receive callback after client closes socket,"<p>I've got a listener socket that accepts, receives and sends as a TCP server typically does.  I've given my accept and receive code below, it's not that different from the <a href=""https://learn.microsoft.com/en-us/dotnet/framework/network-programming/using-an-asynchronous-server-socket"" rel=""nofollow noreferrer"">example on Microsoft's documentation</a>.  The main difference is that my server doesn't kill a connection after it stops receiving data (I don't know if this is a bad design or not?).</p>
<pre><code>private void on_accept(IAsyncResult xResult)
{
    Socket listener = null;
    Socket handler = null;
    TStateObject state = null;
    Task&lt;int&gt; consumer = null;

    try
    {
        mxResetEvent.Set();
        listener = (Socket)xResult.AsyncState;
        handler = listener.EndAccept(xResult);
        state = new TStateObject()
        {
            Socket = handler
        };
        consumer = async_input_consumer(state);
        OnConnect?.Invoke(this, handler);
        handler.BeginReceive(state.Buffer, 0, TStateObject.BufferSize, 0, new AsyncCallback(on_receive), state);
    }
    catch (SocketException se)
    {
        if (se.ErrorCode == 10054)
        {
            on_disconnect(state);
        }
    }
    catch (ObjectDisposedException)
    {
        return;
    }
    catch (Exception ex)
    {
        System.Console.WriteLine(&quot;Exception in TCPServer::AcceptCallback, exception: &quot; + ex.Message);
    }
}

private void on_receive(IAsyncResult xResult)
{
    Socket handler = null;
    TStateObject state = null;
    try
    {
        state = xResult.AsyncState as TStateObject;
        handler = state.Socket;
        int bytesRead = handler.EndReceive(xResult);
        UInt16 id = TClientRegistry.GetIdBySocket(handler);
        TContext context = TClientRegistry.GetContext(id);

        if (bytesRead &gt; 0)
        {
            var buffer_data = new byte[bytesRead];
            Array.Copy(state.Buffer, buffer_data, bytesRead);
            state.BufferBlock.Post(buffer_data);
        }
        Array.Clear(state.Buffer, 0, state.Buffer.Length);
        handler.BeginReceive(state.Buffer, 0, TStateObject.BufferSize, 0, new AsyncCallback(on_receive), state);
    }
    catch (SocketException se)
    {
        if(se.ErrorCode == 10054)
        {
            on_disconnect(state);
        }
    }
    catch (ObjectDisposedException)
    {
        return;
    }
    catch (Exception ex)
    {
        System.Console.WriteLine(&quot;Exception in TCPServer::ReadCallback, exception: &quot; + ex.Message);
    }
}
</code></pre>
<p>This code is used to connect to an embedded device and works (mostly) fine.  I was investigating a memory leak and trying to speed up the process a bit by replicating exactly what the device does (our connection speeds are in the realm of about 70kbps to our device, and it took an entire weekend of stress testing to get the memory leak to double the memory footprint of the server).</p>
<p>So I wrote a C# program to replicate the data transactions, but I've run into an issue where when I disconnect the test program, the server gets caught in a loop where it endlessly has its <code>on_receive</code> callback called.  I was under the impression that <code>BeginReceive</code> wouldn't be triggered until something was received, and it seems to call <code>on_receive</code>, ends the receiving like an async callback should do, process the data, and then I want the connection to await more data so I call <code>BeginReceive</code> again.</p>
<p>The part of my test program where the issue occurs is in here:</p>
<pre><code>private static void read_write_test()
{
    mxConnection = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
    mxConnection.Connect(&quot;12.12.12.18&quot;, 10);
    if (mxConnection.Connected)
    {
        byte[] data = Encoding.ASCII.GetBytes(&quot;HANDSHAKESTRING&quot;); //Connect string
        int len = data.Length;
        mxConnection.Send(data);
        data = new byte[4];
        len = mxConnection.Receive(data);

        if (len == 0 || data[0] != '1')
        {
            mxConnection.Disconnect(false);
            return;
        }
    }

    //Meat of the test goes here but isn't relevant

    mxConnection.Shutdown(SocketShutdown.Both);
    mxConnection.Close();
}
</code></pre>
<p>Up until the <code>Shutdown(SocketShutdown.Both)</code> call, everything works as expected.  When I make that call however, it seems like the server never gets notification that the client has closed the socket and gets stuck in a loop of endlessly trying to receive.  I've done my homework and I think I am closing my connection properly as per <a href=""https://stackoverflow.com/questions/15354946/what-is-the-proper-way-of-closing-and-cleaning-up-a-socket-connection"">this discussion</a>.  I've messed around with the disconnect section to just do <code>mxConnection.Disconnect(false)</code> as well, but the same thing occurs.</p>
<p>When the device disconnects from the server, my server catches a <code>SocketException</code> with error code 10054, which documentation says:</p>
<blockquote>
<p>Connection reset by peer.</p>
<p>An existing connection was forcibly closed
by the remote host. This normally results if the peer application on
the remote host is suddenly stopped, the host is rebooted, the host or
remote network interface is disabled, or the remote host uses a hard
close (see setsockopt for more information on the SO_LINGER option on
the remote socket). This error may also result if a connection was
broken due to keep-alive activity detecting a failure while one or
more operations are in progress. Operations that were in progress fail
with WSAENETRESET. Subsequent operations fail with WSAECONNRESET.</p>
</blockquote>
<p>I've used this to handle the socket being closed and has worked well for the most part.  However, with my C# test program, it doesn't seem like it works the same way.</p>
<p>Am I missing something here?  I'd appreciate any input.  Thanks.</p>
",https://stackoverflow.com/questions/46795559/c-tcp-async-listener-gets-stuck-on-my-on-receive-callback-after-client-closes-s,"['c#', 'sockets', 'tcp']",1781,TRUE,4,2
