linux performance

linux 性能分析

相关工具

压测工具

  • stress: A tool to put given subsystems under a specified load

性能监控工具

  • sysstat: Collection of performance monitoring tools for Linux
    • mpstat : Report processors related statistics.
    • pidstat : Report statistics for Linux tasks.
    • iostat : Report Central Processing Unit (CPU) statistics and input/output statistics for devices and partitions.
    • sar : Collect, report, or save system activity information.
rpm -ql sysstat grep bin

cpu 信息

us - Time spent in user space sy - Time spent in kernel space ni - Time spent running niced user processes (User defined priority) id - Time spent in idle operations wa - Time spent on waiting on IO peripherals (eg. disk) hi - Time spent handling hardware interrupt routines. (Whenever a peripheral unit want attention form the CPU, it literally pulls a line, to signal the CPU to service it) si - Time spent handling software interrupt routines. (a piece of code, calls an interrupt routine…) st - Time spent on involuntary waits by virtual cpu while hypervisor is servicing another processor (stolen from a virtual machine)

  • vmstat : Report virtual memory statistics

processes, memory, paging, block IO, traps, disks and cpu activity

  • cgroup
  • cfs_period/quota
  • cpu shares
  • Cpusets
  • cfs/rt

  • cpu utility

Memory

  • 大页内存
  • 代码段
  • RO data
  • RW data

GPU/FPGA/TPU/ASIC

Burst feature

Gcc & Clang/LLVM

Storage

  • Buffer –> Disk
  • Cache –> File System

cgroup

clang-and-llvm-and-gcc

cpusets

Creating and organizing cgroups

cgroup 基本概念

LVS

worker_cpu_affinity

I’ll Do It Later: Softirqs, Tasklets, Bottom Halves, Task Queues, Work Queues and Timers

bandwith control

tcp keepalive

Bash Beginner


English Writing

sen

  • We are expecting xxx to be revealed

  • it seams like Motorola might be he first brand to offer a phone with this Soc.

Recapping what you said

  • To briefly recap this section, we succeeded in reigniting our sales.
  • Before we move on, allow me to quickly summarize: This year has been a mixed bag. Some success and some failure.
  • Let me quickly go over the key information again. We are well on our way to achieving our goals.

Transitioning to a new point

  • This brings me to my next point, which is about marketing.
  • With this in mind, let’s proceed to look at our production figures.
  • Having examined how we secured the Prettle account, I want to look at new business in general.
  • Now it’s time to talk about the Green Business awards. I’m sure you’re all excited.

  • Well, as you should already know,
  • With this in mind, let’s proceed to how we strived for solutions to our biggest problems
  • First of all,
  • But why social media? The goal should be obvious:
  • The effects of this campaign were immediately visible.
  • It was an exciting success,
  • To recap this part:
  • So, having examined how we tackled our first issue, I’d like to share

  • Addressing such issues had to be, and still is, the number one priority in our team’s pipeline.

Referring back

  • As you can see, we were influenced by the market, a point that was brought up earlier.
  • This is connected to my point about customer information, which we were looking at just now.
  • It’s obvious that we can do better for our customers, which echoes the previous point about our poor sales performance.

Referencing with pronouns

  • We had several issues with the proposal. They were the high price and high risk.
  • Marketing has to be our number one priority. With this in mind …
  • OK, this is what we’re going to do. We’re going to have the company party next week.
  • Addressing such issues has to be our number one priority.

EXPRESSING DOUBT

  • I can accept that.
  • I’m prepared to believe that.
  • I’m willing to go along with the idea.
  • This seems a bit far-fetched.
  • Doesn’t it strike you as odd?
  • It’s highly implausible(not reasonable).
  • this is utter nonsense!
  • That doesn’t make any sense.

usage

  • make sense to…… : It makes sense to centralize the data storage.
  • be involved in ….. : We are deeply involved in the Kubernetes technologies.

stock


dns bgp

DNS

DNS recursor DNS解析器

Root nameserver

TLD nameserver

什么是ASN

什么是任播(Anycast)DNS?

UniCast 单播 MultiCast 多播 BroadCast 广播 实际是 BGP Anycast 任意播或泛播 AnyCast IP拥有MultiCast和UniCast各自的部分特性: 主要靠BGP的路由协议,有多个相同的ip的server,路由协议找到“最近”的一台server

任播指一个IP可以应用到多个服务器上

Ip show / manipulate routing, devices, policy routing and tunnels

What is a DNS zone?

A DNS zone is a portion of the DNS namespace that is managed by a specific organization or administrator. 一个DNS zone是DNS名字空间的一部分,它被特定组织和管理机构管理。

DNS root server

TLD server

Akamai

  • Keywords Akamai, CDN, overlay networks, application acceleration, HTTP, DNS, content delivery, quality of service, streaming media
    1. INTERNET APPLICATION REQUIREMENTS
    1. INTERNETDELIVERYCHALLENGES
    1. DELIVERY NETWORK OVERVIEW
  • 4.1 Delivery Networks as Virtual Networks
  • 4.2 Anatomy of a Delivery Network
  • 4.3 System Design Principles
    1. HIGH-PERFORMANCE STREAMING AND CONTENT DELIVERY NETWORKS
  • 5.1 Video-grade Scalability
  • 5.2 StreamingPerformance
  • 5.3 A Transport System for Contentand Streaming Media Delivery
    1. HIGH-PERFORMANCE APPLICATION DELIVERY NETWORKS
  • 6.1 A Transport System for Application Acceleration
  • 6.2 Distributing Applications to the Edge
    1. PLATFORM COMPONENTS
  • 7.1 Edge Server Platform
  • 7.2 Mapping System
  • 7.3 Communications and Control System
  • 7.4 Data Collection and Analysis System
  • 7.5 Additional Systems and Services
    1. EXAMPLE:MULTI-LEVEL FAILOVER

Akamai DNS:Providing Authoritative Answers to the World’s Queries

  • 2 CHARACTERIZING QUERY TRAFFIC
  • 3 SYSTEM ARCHITECTURE
  • 3.1 Authoritative Nameservers
  • 3.2 Supporting Components
  • 4 RESILIENCY
  • 4.1 Anycast Failover Mechanism
  • 4.2 Failure Resiliency
  • 4.3 Attack Resiliency
  • 5 DNS PERFORMANCE
  • 5.1 Anycast Performance Tuning
  • 5.2 Two-Tier Delegation System

End-User Mapping: Next Generation Request Routing for Content Delivery

    1. THE MAPPING SYSTEM
  • 2.1 End-User Mapping
  • 2.2 Mapping System Architecture
    1. UNDERSTANDING CLIENTS AND THEIR NAME SERVERS
  • 3.1 Collecting Client-LDNS pairs
  • 3.2 How far are clients from their LDNSes
  • 3.3 How far are clients that use the same LDNS from each other?
    1. PERFORMANCE IMPACT
  • 4.1 Performance metrics
  • 4.2 Collecting performance information
  • 4.3 Performance Analysis
  • 4.4 Why Download Performance Matters
  • 4.5 The Benefits of EDNS0 Adoption
    1. SCALING CHALLENGES
  • 5.1 Tradeoffs in choosing the mapping units
  • 5.2 Dealing with greater DNS query rates

references


big ideas 2021

1. Deep Learning

  • Conversational Computers
  • Self-Driving Cars
  • Consumer Apps

Deep Learning Is Creating A Boom In AI Chips AI Is Expanding From Vision To Language OpenAI’s GPT-3 Is The First AI That “Understands” Language

Deep Learning Could Create More Economic Value Than The Internet Did.

  • added $13 trillion by Internet
  • Deep learning has created $2 trillion in market capitalization as of 2020.
  • ARK believes that deep learning will add $30 trillion to equity market capitalizations during the next 15-20 years.

The Re-Invention of the Data Center

ARM, RISC-V, and graphics processing units (GPUs) New Architectures Re-Invent The Data Center Every Few Decades Intel Seems Frozen In Time ARM Could Power The Majority Of Developer PCs By 2030 ARM Could Become The New Standard In The Cloud ARM & RISC-V Could Become The New Processor Standards By 2030 By 2030, The Accelerator Should Replace The CPU As The Main Server Compute Engine ARK Believes That Server Processors Will Transform In The Next Decade.

Virtual Worlds

Video Game Monetization Models Are Shifting To Virtual Goods ARK Believes The Monetization Of Gaming Will Increase Video Games Are Becoming “Third Places“ Away From Home And Work Augmented Reality (AR) Is Primed To Scale “Virtual Reality” Could Approach Reality By 2030 The Revenue From Virtual Worlds Could Approach $400 Billion By 2025.

Digital Wallets

Incubated In China, Mobile Payments Are 2.5x Its GDP In The US, Digital Wallet Users Are Surpassing The Number Of Deposit Account Holders At The Largest Financial Institutions Digital Wallets Can Acquire Customers For A Fraction Of Banks’ Customer Acquisition Costs Traditional Banks Are Facing Potentially Sizeable Risks At Maturity, Each Digital Wallet User Could Be Worth Roughly $20,000

Bitcoin’s Fundamentals

As Support For Its Network Increased, Bitcoin’s Price Hit An All-time High In Late 2020 Bitcoin Could Play A Pivotal Role As Corporate Cash.

Bitcoin: Preparing For Institutions

ARK Believes Bitcoin Deserves A Strategic Allocation In Institutional Portfolios Bitcoin Trading Volume Is Comparable To That Of A Large Cap Stock And Has Grown At An Exponential Rate Institutional Investors Can Access Bitcoin In Sophisticated Ways We Believe Bitcoin Has Earned An Allocation In Well-Diversified Portfolios

Electric Vehicles (EVs)

Electric Vehicle Sales Have Taken Share In Good Times And Tough Times Wright’s Law Has Modeled The Decline In Battery Costs Successfully In Addition To Cost, EVs Are Competing On Range And Performance

Automation

The US Economy Is At Automation Levels Similar To That Of US Manufacturing In The Early 1990s Increased Automation And Productivity Can Provide Many Economic Benefits Automation could add 5%, or $1.2 trillion, to US GDP during the next five years. ARK believes automation will boost US real GDP growth by 100 basis points on average per year to 3.4%.

Autonomous Ride-Hailing

Robotaxis Should Expand The Ride-Hailing Market Three Autonomous Strategies Are Evolving

Drone Delivery

Drones Should Reduce The Cost To Transport Goods And People Dramatically Autonomous Air Travel Has Become Possible And Affordable Drones Could Deliver A Substantial Share Of E-Commerce Shipments By 2030 Drones Should Accelerate The Shift To Food Delivery

Orbital Aerospace

Lower Satellite Launch Costs Could Enable Continuous Global Coverage With Low Latency

3D Printing

3D Printing Applications Vary By Industry, Volumes, And Complexity 3D Printing Enables Many Form Factors

Long-Read Sequencing

The Genomic ‘Toolkit’ Is Expanding To Provide A Fuller, Richer, And More Accurate View Into Biology Historically, Researchers Had To Choose Between Accuracy With SRS Or Comprehensiveness With LRS As Costs For LRS Converge With SRS, Many Clinical Applications Could Shift To LRS

Multi Cancer Screening

Diagnosed Early, Cancer Can Be Treated Successfully Based On A Single Blood Test, Multi-Cancer Screening Can Detect Dozens Of Early-Stage Cancers Thanks To Rapidly Declining Costs, Multi-Cancer Screening Is Approaching A Reimbursable Price Point Multi-Cancer Screening Could Prevent Roughly 66,000 Cancer Deaths Annually In The US Multi-Cancer Screening And Other Genomic Technologies Are Transforming Oncology

Cell and Gene Therapy: Generation 2

Cancer Therapies Are Shifting From Liquid To Solid Tumors Oncology Trials Are Shifting From Autologous To Allogeneic Cell Therapies Gene Therapies Could Shift From Ex Vivo To In Vivo Editing


paper

NLP

  • ColBERT-Efficient and Effective Pasage Search via Contextualized Late Interaction over BERT 2004.12832

embeding representation attention

  • Highly accurate protein structure prediction with AlphaFold
  • Accurate prediction of protein structures and interactions using a three-track neural network

  • RoseTTAFold

Scheduling

Borg, Omega, and Kubernetes

  • Application environment
  • Containers as the unit of management

An Overview of Openstack Architecture

Orchestration is the beginning, not the end

ReplicationController DaemonSet Job

Don’t make the container system manage port numbers Don’t just number containers: give them labels Be careful with ownership Don’t expose raw state

2.1 Computing Nova: Glance: It’s the Openstack Image service 2.2 Networking Neutron: 2.3 Storing Swift: Cinder: 2.4 Shared Services Keystone: Horizon: Ceilometer: 2.5 Supporting Services Database: Advanced Message Queue Protocol:

Large-scale cluster management at Google with Borg

hundreds of thousands of jobs, from many thousands of differ- ent applications, across a number of clusters each with up to tens of thousands of machines. (1) hides the details of resource management and failure handling so its users can focus on application development instead; (2) operates with very high reliability and availability, and supports applica- tions that do the same; (3) lets us run workloads across tens of thousands of machines effectively.

minimize fault-recovery time scheduling policies that reduce the probability of correlated failures

workload

  • long-running
  • batch jobs(short-term)

MapReduce system [23], FlumeJava [18], Millwheel [3], and Pregel [59]

Constraints can be hard or soft; resource requirements

2.5 Priority, quota, and admission control 2.6 Naming and monitoring

3 Borg architecture 3.1 Borgmaster 3.2 Scheduling

resource manager and scheduling 3.3 Borglet 3.4 Scalability

4 Availability 5 Utilization

Omega: flexible, scalable schedulers for large compute clusters 调度器扩展

  • 并行parallelism
  • 共享状态 shared state (集群中的所有资源,相对于资源分组给不同的调度器)
  • 无锁的乐观并行控制

monolithic cluster scheduler architectures. 整体的;巨石的,庞大的;完全统一的 集群的增大,使调度器更加复杂,也容易遇到调度器瓶颈 双层调度器,资源管理器保证并行的数据一致性, Mesos [13] and Hadoop-on-Demand [4]

Omega: shared state, using lock-free optimistic concurrency control 需求

  • 利用率要高(high resource utilization)
  • 用户要求的约束(user-supplied placement constraints)
  • 快速决策 (rapid decision making)
  • 各种级别的公平性 (various degrees of “fairness” )
  • 商业重要性 (business importance)
  • 健壮性和可用性

混布(batch and low-latency jobs) 问题:增加了复杂度

types of jobs, flexibly support job-specific policies, scale to an ever-growing amount of scheduling work

pessimistic approach: a particular resource is only made available to one scheduler at a time optimistic approach: detects the (hopefully rare) conflicts, and undoes one or more of the conflicting claims. The optimistic approach increases parallelism, but potentially increases the amount of wasted scheduling work if conflicts occur too frequently.

  • Naming and service discovery
  • Master election, using Chubby
  • Application-aware load balancing

Two-level scheduling

Mesos [13] and Hadoop-on-Demand (HOD) YARN

Mesos

  • 支持不同的调度器,希望做得更加通用。

Hawk

  • 中心调度,调度长运行时的服务
  • 分布式调度,调度短时任务
  • Splitting the cluster
  • 预留专有的少量服务器跑short tasks; long tasks被调度到其他大量的服务器上;short tasks可以被调度到所有服务器上
  • Randomized task stealing

Hawk uses task stealing as a run-time mechanism aimed at mitigating some of the delays caused by the occasion- ally suboptimal, distributed scheduling decisions.

  • Scheduling long jobs

  • Overall results on the Google trace

  • conclusions
  • 高负责集群
  • 多样的workloads
  • 主要是短时jobs
  • 少量的长时jobs

2013-Apache Hadoop YARN- Yet Another Resource Negotiator

2015atc-Mercury- Hybrid Centralized and Distributed Scheduling in Large Shared Clusters

  • hybrid approach

Shared-state scheduling

Omega

There is no central resource allocator in Omega

Each scheduler is given a private, local, frequently-updated copy of cell state that it uses for making scheduling decisions.

50–70% of MapRe- duce jobs can benefit from acceleration using opportunistic resources

Apache Mesos YARN [76] V. K. Vavilapalli, A. C. Murthy, C. Douglas, S. Agarwal, M. Konar, R. Evans, T. Graves, J. Lowe, H. Shah, S. Seth, B. Saha, C. Curino, O. O’Malley, S. Radia, B. Reed, and E. Baldeschwieler. Apache Hadoop YARN: Yet Another Resource Negotiator. In Proc. ACM Symp. on Cloud Computing (SoCC), Santa Clara, CA, USA, 2013. Facebook’s Tupperware Microsoft’s Apollo system [13] E. Boutin, J. Ekanayake, W. Lin, B. Shi, J. Zhou, Z. Qian, M. Wu, and L. Zhou. Apollo: scalable and coordinated scheduling for cloud-scale computing. In Proc. USENIX Symp. on Operating Systems Design and Implementation (OSDI), Oct. 2014.


Transformer GPT-3 (1750亿参数) OpenAI 万亿级的参数 稀疏化、 多模态 多模态预训练


Attention Is All You Need

Scaled Dot-Product Attention Multi-Head Attention

Embeddings and Softmax Positional Encoding

Why Self-Attention

Machine Translation Model Variations

Rearchitecting Kubernetes for the Edge

algorithms

dynamic placement for clustered web applications


travelling salesman problem(TSP) vehicle routing problem(VRP) theory of computational complexity 复杂性理论 combinatorial optimization NP-complete problem NP-hard problem optimal control problem 最佳控制问题 integer linear program 整数线性规划

Online Service Placement and Request Scheduling in MEC Networks

Methodology and Contributions

  • Online Framework
  • Regularization with look-Ahead Algorithm
  • Rounding Algorithm
  • Evaluation Results

On the Measure of Intelligence

define and evaluate intelligence in a way that enables comparisons between two systems

I Context and history I.1 Need for an actionable definition and measure of intelligence I.2 Definingintelligence:twodivergentvisions I.3 AI evaluation: from measuring skills to measuring broad abilities

A new perspective II.1 Criticalassessment II.2 Definingintelligence:aformalsynthesis II.3 Evaluatingintelligenceinthislight II.3.1 Fair comparisons between intelligent systems II.3.2 What to expect of an ideal intelligence benchmark

III A benchmark proposal: the ARC dataset III.1 Descriptionandgoals III.1.2 Core Knowledge priors III.2 Weaknesses and future refinements II.3 Evaluatingintelligenceinthislight

A Survey on Resource Scheduling in Cloud Computing: Issues and Challenges

  • resource provisioning
  • resource scheduling

Akamai DNS: Providing Authoritative Answers to the World’s Queries

two types of systems

  • The client-side system pri- marily consists of recursive resolvers that are charged with resolving queries from end-users.
  • The authoritative system is organized hierarchically in accor- dance with the name hierarchy.

Akamai DNS

architecture, algorithms, design principles, and operation

Authoritative DNS Services(3)

  • hosting service (ADHS) that allows enterprises to host their DNS domains on Akamai.
  • global traffic management (GTM) that allows DNS-based load-balancing among server deployments owned by an enterprise.
  • Akamai DNS is a component of Akamai’s CDN service, serving 15-20% of all web traffic

DNS hosting for their domains, GTM for their datacenters, and CDN services for edge delivery of their content fetched from those datacenters.

Akamai DNS is architected to be resilient to both failures and attacks. Akamai DNS is architected for both scalability and performance. Akamai DNS is architected for rapid reconfigurability.(Unlike traditional authoritative DNS whose translations remain relatively static)

3.9M to 5.6M queries per second (qps)

SYSTEM ARCHITECTURE

  • Authoritative Nameservers
  • Cloudflare 1.1.1.1 Public Recursive Resolver
  • Google Public DNS. (2019). Retrieved June 2019 from https://developers.google.com/speed/public-dns/
  • Quad9 DNS Service. (2019). Retrieved June 2019 from https://www.quad9.net/

resolvers and the authoritative nameservers.

4 RESILIENCY

  • 4.1 Anycast Failover Mechanism
  • 4.2 Failure Resiliency
  • 4.2.1 Machine-Level Failures
  • 4.2.2 Stale State.
  • 4.2.3 Input-induced Failure.
  • 4.3 Attack Resiliency
  • 4.3.4 Attack Scenarios and their Mitigations.
  • saturate the available bandwidth
  • send DNS queries directly to consume compute or bandwidth resource
  • Random Subdomain 随机子域名查询,较低前面解析器的命中率,直接透传到权威服务器上
  • Spoofed Source IP
  • Spoofed Source IP & IP TTL

legitimate queries 合法的 suspicious queries 可疑的

5 DNS PERFORMANCE

  • 5.1 Anycast Performance Tuning
  • 5.2 Two-Tier Delegation System

Two-Tier can reduce resolution time in most situations over Akamai’s single-tier of toplevels.

6 RELATED WORK

7 CONCLUDING REMARKS

the key design principles that underlie the ar- chitecture of Akamai DNS

  • (i) Avoid single points of failure (§4.3.1)
  • (ii) Use general mitigation strategies for failure modes rather than specific point solutions, as such strategies potentially also cover unanticipated failure modes (§4.2),
  • (iii) Under widespread failure, continue to operate in a degraded state as the alternative is not operating at all (§4.2.1),
  • (iv) Build in contingencies for even extremely unlikely but high impact scenarios, so that Akamai DNS is always available (§4.2.3, §4.2.4),
  • (v) Avoid actively reacting to an attack – instead rely upon automated mitigations – until action becomes absolutely necessary (§4.3.2).

Akamai

    1. INTERNET APPLICATION REQUIREMENTS
    1. INTERNETDELIVERYCHALLENGES
    1. DELIVERY NETWORK OVERVIEW
  • 4.1 Delivery Networks as Virtual Networks
  • 4.2 Anatomy of a Delivery Network
  • 4.3 System Design Principles
    1. HIGH-PERFORMANCE STREAMING AND CONTENT DELIVERY NETWORKS
  • 5.1 Video-grade Scalability
  • 5.2 StreamingPerformance
  • 5.3 A Transport System for Contentand Streaming Media Delivery
    1. HIGH-PERFORMANCE APPLICATION DELIVERY NETWORKS
  • 6.1 A Transport System for Application Acceleration

  • 7.1 Edge Server Platform
  • 7.2 Mapping System
  • 7.3 Communications and Control System
  • 7.4 Data Collection and Analysis System
  • 7.5 Additional Systems and Services
    1. EXAMPLE:MULTI-LEVEL FAILOVER

Akamai DNS:Providing Authoritative Answers to the World’s Queries

  • 2 CHARACTERIZING QUERY TRAFFIC
  • 3 SYSTEM ARCHITECTURE
  • 3.1 Authoritative Nameservers
  • 3.2 Supporting Components
  • 4 RESILIENCY
  • 4.1 Anycast Failover Mechanism
  • 4.2 Failure Resiliency
  • 4.3 Attack Resiliency
  • 5 DNS PERFORMANCE
  • 5.1 Anycast Performance Tuning
  • 5.2 Two-Tier Delegation System
    1. ROLE OF SERVER DEPLOYMENTS
    1. RELATED WORK

internet delivery challenges

  • Peering point congestion
  • Inefficient routing protocols
  • Unreliable networks
  • Inefficient communications protocols

LLM

  • papers

https://www.bmc.com/blogs/machine-learning-ai-frameworks/ https://blog.dominodatalab.com/choosing-the-right-machine-learning-framework/ https://blog.google/products/search/search-language-understanding-bert/ https://www.zhihu.com/question/68482809 https://mwhittaker.github.io/papers/html/burns2016borg.html https://www.nextplatform.com/2015/05/05/google-omega-to-become-part-of-borg-collective/ Online Service Placement and Request Scheduling in MEC Networks On the Measure of Intelligence NIPS 2021 What is Anycast? | How does Anycast work? Joint Heterogeneous Server Placement and Application Configuration in Edge Computing [10] Apollo: Scalable and Coordinated Scheduling for Cloud-Scale Computing This paper is included in the Proceedings of the 11th USENIX Symposium on Operating Systems Design and Implementation. October 6–8, 2014 • Broomfield, CO 978-1-931971-16-4 OSDI 11th [11] Mesos- A Platform for Fine-Grained Resource Sharing in the Data Center [12] 2015atc_Hawk-Hybrid Datacenter Scheduling [13] 2020 Autopilot: workload autoscaling at Google [14] Borg: the Next Generation [15] A Survey on Resource Scheduling in Cloud Computing: Issues and Challenges

  • [16] 2010The-akamai-network-a-platform-for-high-performance-internet-applications
  • [17] google public-dns
  • [18] LLM