In this article I am going to share with you an interesting case of how an optional feature makes a software library completely unusable on non-AMD64 hardware.
The software library is Apache Parquet.
Apache Parquet is a columnar storage format available to any project in the Hadoop ecosystem, regardless of the choice of data processing framework, data model or programming language.
While storing data Parquet may use compression to reduce the size on the disk. The list of supported compression formats are listed at parquet.thrift — Snappy, Gzip, LZO, Brotli, LZ4 and ZSTD.
From the website:
Concourse is an open-source continuous thing-doer.
ConcourseCI is a light-weight continuous integration/deployment server. It is written in Golang and is maintained by a team at Pivotal/VMWare.
There are many CI/CD solutions out there but not all of them support ARM64 CPU architecture. And CouncourseCI is one of them! The latest version at the moment provides only AMD64 binaries for Linux, MacOS and Windows. There is an open issue since July 2017. …
Do you know how your software processes network calls ?
Unless you use a low level programming language you most probably didn’t need to care about such details. If you are a web developer then most probably you just start Apache Tomcat or Netty server and let them do the low level work, while your code deals with the application business logic (high level work). To squeeze as much performance of your OS and hardware as possible Netty itself implements the plumbing with the OS network stack in its native transport implementations. But Apache Tomcat and almost any other JVM…
In this article I am going to explore whether this gives us any advantages.
Recently I’ve shared an article comparing the performance of several HTTP2 web servers. For the purpose of this article I am going to create a native image of the embedded Apache Tomcat application and see whether this is going to improve the results.
There are Linux x86_64 and aarch64 distributions for…
To enable HTTP2 support in Apache Tomcat one should just add
<UpgradeProtocol className=”org.apache.coyote.http2.Http2Protocol” />
to a Connector. Here is a more complete Connector config:
The web browsers support HTTP2 only over TLS encrypted connection! That’s the reason for the SSLHostConfig.
If you don’t specify <SSLHostConfig> then Tomcat will enable HTTP2 over clear text — the so called
h2c. But h2c can be consumed only with non-browser http clients.
What is Varnish Cache ?
From project’s Wiki page:
Varnish is very flexible and as such can be used as a caching engine , a load balancer , a web application firewall, an edge authentication and authorization mechanism. Other use cases are HTTP routing, hotlinking protection, DDoS attack defender and, a lot, more.
Varnish is a reverse-proxy HTTP accelerator designed for heavily consumed API endpoints and also for dynamic, heavy-content, high-traffic websites.
To compare its performance I am going to use it as…
Note: the VMs are as close as possible in their hardware capabilities — same type and amount of RAM, same disks, network cards and bandwidth. Also the CPUs are as similar as possible but there are some differences
Both VMs run Ubuntu 20.04 …
While profiling Apache Tomcat trying to figure out why the request throughput under very high load is twice better on x86_64 than on aarch64 CPU architecture I’ve noticed that there is a high thread contention when using org.apache.tomcat.util.collections.SynchronizedQueue and org.apache.tomcat.util.collections.SynchronizedStack.
./profiler.sh -e lock -d 60 <TOMCAT_PID>
gave me the following output:
Started [lock] profiling --- Execution profile --- Total samples : 713834 Frame buffer usage : 0.0288% --- 1106165618177 ns (58.97%), 395609 samples [ 0] org.apache.tomcat.util.collections.SynchronizedStack [ 1] org.apache.tomcat.util.collections.SynchronizedStack.push [ 2] org.apache.tomcat.util.net.NioBlockingSelector.write [ 3] org.apache.tomcat.util.net.NioSelectorPool.write [ 4] org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.doWrite [ 5] org.apache.tomcat.util.net.SocketWrapperBase.doWrite [ 6] org.apache.tomcat.util.net.SocketWrapperBase.flushBlocking [ 7] org.apache.tomcat.util.net.SocketWrapperBase.flush […
java.text.SimpleDateFormat is a well known utility used by Java developers for formatting and parsing dates. It is available since the early versions of Java, most probably since version 1.0.
Its API is simple and intuitive
SimpleDateFormat formatter = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss Z");String formatted = formatter.format(new java.util.Date());Date date = formatter.parse("Wed, 4 Jul 2001 12:08:56 -0700");
but it has drawbacks. Here are few of them:
What is Memcached ?
From Wikipedia: Memcached is a general-purpose distributed memory-caching system. It is often used to speed up dynamic database-driven websites by caching data and objects in RAM to reduce the number of times an external data source (such as a database or API) must be read.