Tuesday, November 23, 2021

how to use reactor scheduler in micro-services

Depending on how many cores we have for your micro-services, we may have as low as 4 threads (reactor-http-nio- or reactor-http-epoll-) when it comes to listening and talking to outside. If these threads are blocked in a way we didn't expect, the performance could be worse than traditional synchronised paradigm. Here're a few examples to show how it works when offloading blocking operations to a larger thread pool at different places. Logs happen at doOnSubscribe and doOnSuccess.

no scheduler
[ctor-http-nio-4] Controller     : Received request
[ctor-http-nio-4] ServiceClient  : Getting something
[ctor-http-nio-4] ServiceClient  : Got something in 116ms
[ctor-http-nio-4] Controller     : Processed in 120ms

scheduler on subscribeOn WebClient call to 3rd party
[ctor-http-nio-3] Controller     : Received request
[    scheduler-3] ServiceClient  : Getting something
[ctor-http-nio-4] ServiceClient  : Got something in 116ms
[ctor-http-nio-4] Controller     : Processed in 120ms

scheduler on publishOn WebClient call to 3rd party
[ctor-http-nio-5] Controller     : Received request
[ctor-http-nio-5] ServiceClient  : Getting something
[   scheduler-12] ServiceClient  : Got something in 116ms
[   scheduler-12] Controller     : Processed in 120ms

scheduler on subscribeOn and publishOn WebClient call to 3rd party
[ctor-http-nio-3] Controller     : Received request
[    scheduler-3] ServiceClient  : Getting something
[    scheduler-4] ServiceClient  : Got something in 116ms
[    scheduler-4] Controller     : Processed in 120ms

Bonus cases to make things even tricky.

subscribeOn after doOnSubscribe in controller
[undedElastic-21] Controller     : Received request
[undedElastic-21] ServiceClient  : Getting something
[ctor-http-nio-7] ServiceClient  : Got something in 116ms
[ctor-http-nio-7] Controller     : Processed in 120ms

subscribeOn before doOnSubscribe in controller
[ctor-http-nio-3] Controller     : Received request
[undedElastic-21] ServiceClient  : Getting something
[ctor-http-nio-4] ServiceClient  : Got something in 116ms
[ctor-http-nio-4] Controller     : Processed in 120ms

Saturday, October 23, 2021

how to get better quality on PSP games in RetroArch

 I don't have a very powerful machine to run simulators. Here're the bare minimum changes I made to PPSSPP core.

  • set Internal Resolution (Restart) to 960x544 (2x)
  • set Texture Scaling Level to 5x
Can you tell the difference between the 2?

Friday, October 08, 2021

how to temporarily increase resolution in Ubuntu

I'm happy with 1366 x 768, however it's not vertically enough for some software. Here's how you can increase resolution temporarily.

$ xrandr --output LVDS-1 --panning 1708x960 --scale 1.25x1.25

Or you can even make it a 16:10 by 

$ xrandr --output LVDS-1 --panning 1600x1000 --scale 1.171x1.302

You can reset resolution by log out and log in again, or

$ xrandr --output LVDS-1 --panning 1366x768 --scale 1x1   


Tuesday, September 14, 2021

subvolumes to reduce changed files when using Snapper

I enabled Snapper on @home subvolume and found there're too many files changed hourly. Below subvolumes are created to get rid of most files between snapshots.

@home/jerry/.config

@home/jerry/.cache

@home/jerry/.local

@home/jerry/Downloads

Don't forget to chown and chgrp to jerry.

Tuesday, May 11, 2021

Customise IntelliJ IDEA

I'm happy with default behaviour of this IDE overall. Here're the only couple of settings I'd like to change.