19 June 2019

Contention RollingFileManager.checkRollover()

Contention at: org.apache.logging.log4j.core.appender.rolling.RollingFileManager.checkRollover()

This is a problem with high concurrency, and it works as designed. The file system (I/O) doesn't have  enough performance as required.

The synchronized makes BLOCKED some Java monitor when trying to acquire the resource.
 
/**
 * Determines if a rollover should occur.
 * @param event The LogEvent.
 */
public synchronized void checkRollover(final LogEvent event) {
    if (triggeringPolicy.isTriggeringEvent(event)) {
        rollover();
    }
}

The solution as mentioned above is to move to Async logging.
https://logging.apache.org/log4j/2.x/manual/async.html

JMC Events

From the Event Types tab, look at the color of each event.

Yellow represents Java Monitor Wait events.
The yellow part is when threads are waiting for an object. This often means that the thread is idle, perhaps waiting for a task.

Red represents the Java Monitor Blocked events or synchronization events. If your Java application's important threads spend a lot of time being blocked, then that means that a critical section of the application is single threaded, which is a bottleneck.

Blue represents the Socket Reads and Socket Writes events. Again, if the Java application spends a lot of time waiting for sockets, then the main bottleneck may be in the network or with the other machines that the application communicates.


https://docs.oracle.com/javase/10/troubleshoot/troubleshoot-performance-issues-using-jfr.htm

http://java-performance.info/oracle-java-mission-control-overview/#more-921

10 May 2019

Fallacies of distributed computing

The fallacies are:[1]

Although, there are some writings about they are not fallacies anymore... 

07 May 2019

HTTP 1.0 Performance


HTTP 1.0 had performance issues by slow-start of TCP. The 3-way handshaking was guilty.


https://devwebcl.blogspot.com/2018/09/tcpip-illustrated.html

This was fixed in HTTP 1.1 reusing the connections. Similar to a pool of TCP connections.

2.

  • Under HTTP 1.0, connections are not considered persistent unless a keepalive header is included,[1]

    -Dhttp.keepAlive=false (it can be configured at java system property)

  •  In HTTP 1.1, all connections are considered persistent unless declared otherwise.[2]


Resources:

- https://www.w3.org/Protocols/HTTP/1.0/HTTPPerformance.html
- https://hpbn.co/http1x/
- https://blog.insightdatascience.com/learning-about-the-http-connection-keep-alive-header-7ebe0efa209d
- https://en.wikipedia.org/wiki/HTTP_persistent_connection#HTTP_1.0
- https://en.wikipedia.org/wiki/TCP_congestion_control


02 May 2019

HTTP client timeouts

https://docs.spring.io/autorepo/docs/spring-framework/4.1.7.RELEASE/javadoc-api/org/springframework/http/client/HttpComponentsClientHttpRequestFactory.html

        HttpComponentsClientHttpRequestFactory requestFactory =
                new HttpComponentsClientHttpRequestFactory();

        requestFactory.setConnectionRequestTimeout(connectRequestTimeout);
        requestFactory.setConnectTimeout(connectTimeout);
        requestFactory.setReadTimeout(readTimeout);

       


setConnectionRequestTimeout(int connectionRequestTimeout)
Set the timeout in milliseconds used when requesting a connection from the connection manager using the underlying HttpClient.
(del manager!, del http pool, si no tiene conexiones para ofrecer)


setConnectTimeout(int timeout)
Set the connection timeout for the underlying HttpClient.
(conexion con el server)


setReadTimeout(int timeout)
Set the socket read timeout for the underlying HttpClient.
(lectura del response).

26 April 2019

Hipérbaton

Del lat. hyperbăton, y este del gr. ὑπερβατόν hyperbatón.
 
1. m. Ret. Alteración del orden que las palabras tienen habitualmente en el discurso, como en por mi mano plantado tengo un huerto.

 

11 April 2019

Knuth Quilt

A quick straightforward (and slow) ruby code to create Knuth quilt from Donald Knuth's TAoCP Pre-Fascicle 1a: Bitwise Tricks and Techniques


https://dzone.com/articles/patchwork-quilt-pattern-ruby

 


 

Blog Archive

Disclaimer

Qux