19 July 2019

Service migration

Co-exist different endpoints for migration purposes. It will be good to apply: Strangler Pattern: Service Migration Strategy.


UPDATE1 (14.04.2021): There are other writings from Fowler about the approach of this strategy (different names, with some minor changes).

https://www.martinfowler.com/bliki/ParallelChange.html (The API expand-contract pattern)

https://martinfowler.com/articles/consumerDrivenContracts.html

 


01 July 2019

Continuous: Integration --> Delivery --> Deployment

Continuous integration:  The concept here is to have multiple devs on a project to keep the main branch of the repo to the most current form of the source code, so each dev can check out or pull from the latest code to avoid conflicts.

Continuous integration puts a great emphasis on testing automation to check that the application is not broken whenever new commits are integrated into the main branch.

Continuous Delivery is a small build cycle with short sprints…
Where the aim is to keep the code in a deployable state at any given time. This does not mean the code or project is 100% complete, but the feature sets that are available are vetted, tested, debugged and ready to deploy, although you may not deploy at that moment.  The focus and key here are to keep the code base at a deployable state.

Continuous delivery is an extension of continuous integration to make sure that you can release new changes to your customers quickly in a sustainable way.

Continuous Deployment, every change that is made is automatically deployed to production.
Continuous deployment goes one step further than continuous delivery.

https://stackify.com/continuous-delivery-vs-continuous-deployment-vs-continuous-integration/
https://www.atlassian.com/continuous-delivery/principles/continuous-integration-vs-delivery-vs-deployment

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


Blog Archive

Disclaimer

Qux