Monday, March 16, 2015

3-16-15

Mechanical sympathy - key points.


1) RAM is the new Disk.
2) Disk is the new tape back up.


3) Context switching is slow, L1, L2 cache misses are a bear


4) High-speed = running more things in one thread, less threads = more speed
5) Ways to do #4 Akka, QBit, Vertx, Node.js
6) Node.js does not scale out well (great for small, medium apps)

7) Pure Reactive does not work well with server-side apps, you need a mix
8) Reactive + Worker pools = Vertx, QBit

9) Java wins the server-side dev speed stack. Beats Go, Rust, etc.
10) Java is SLOW at SSL
11) Terminate SSL at ha_proxy, NginX, etc. 

12) Data safety = REPLICATION not transaction
13) Things are cheaper done in batches especially IO


Updating qbit examples to work with version 0.7.2

----------------------------------------------------------
http://www.infoq.com/news/2008/06/ram-is-disk 
great article...

Jim Gray, a man who has contributed greatly to technology over the past 40 years, is credited with saying that memory is the new disk and disk is the new tape. With the proliferation of "real-time" web applications and systems that require massive scalability, how are hardware and software relating to this meme?

M]emory is several orders of magnitude faster than disk for random access to data (even the highest-end disk storage subsystems struggle to reach 1,000 seeks/second). Second, with data-center networks getting faster, it’s not only cheaper to access memory than disk, it’s cheaper to access another computer’s memory through the network.

flash forward two years and we find that the trend in hardware advances has continued for RAM and network and stayed slow for disk.

Memory is the new disk! With disk speeds growing very slowly and memory chip capacities growing exponentially, in-memory software architectures offer the prospect of orders-of-magnitude improvements in the performance of all kinds of data-intensive applications. Small (1U, 2U) rack-mounted servers with a terabyte or more or memory will be available soon, and will change how we think about the balance between memory and disk in server architectures. Disk will become the new tape, and will be used in the same way, as a sequential storage medium (streaming from disk is reasonably fast) rather than as a random-access medium (very slow). Tons of opportunities there to develop new products that can offer 10x-100x performance improvements over the existing ones.

cache - overview 

http://en.wikipedia.org/wiki/CPU_cache


When the processor needs to read from or write to a location in main memory, it first checks whether a copy of that data is in the cache. If so, the processor immediately reads from or writes to the cache, which is much faster than reading from or writing to main memory.

Most modern desktop and server CPUs have at least three independent caches: an instruction cache to speed up executable instruction fetch, a data cache to speed up data fetch and store, and a translation look aside buffer (TLB) used to speed up virtual-to-physical address translation for both executable instructions and data. The data cache is usually organized as a hierarchy of more cache levels (L1, L2, etc..)




Data is transferred between memory and cache in blocks of fixed size, called cache lines. When a cache line is copied from memory into the cache, a cache entry is created. The cache entry will include the copied data as well as the requested memory location (now called a tag).

When the processor needs to read or write a location in main memory, it first checks for a corresponding entry in the cache. The cache checks for the contents of the requested memory location in any cache lines that might contain that address. If the processor finds that the memory location is in the cache, a cache hit has occurred. However, if the processor does not find the memory location in the cache, a cache miss has occurred. In the case of:

- a cache hit, the processor immediately reads or writes the data in the cache line
- a cache miss, the cache allocates a new entry and copies in data from main memory, then the request is fulfilled from the contents of the cache.

Context switching

http://en.wikipedia.org/wiki/Context_switch

a context switch is the process of storing and restoring the state (context) of a process or thread so that execution can be resumed from the same point at a later time. This enables multiple processes to share a single CPU and is an essential feature of a multitasking operating system. What constitutes the context is determined by the processor and the operating system.

Context switches are usually computationally intensive, and much of the design of operating systems is to optimize the use of context switches. Switching from one process to another requires a certain amount of time for doing the administration – saving and loading registers and memory maps, updating various tables and lists etc.



High-speed = running more things in one thread



continue from here.....

No comments:

Post a Comment