Java Performance:Biggest Mistakes презентация

Содержание

And this is where I am from

Слайд 1More on http://blog.dynatrace.com
Dynatrace Free Trial: http://bit.ly/dttrial
Andreas Grabner - @grabnerandi
Java Performance: Biggest Mistakes


Слайд 2And this is where I am from


Слайд 5Can you tell my age by looking at my first computer?


Слайд 6That’s why I ended up talking about performance





Слайд 7Nobody wants this …


Слайд 9Nor this …


Слайд 11
As it leads to this …


Слайд 12

The “War Room”

Facebook – December 2012


Слайд 13And potentially to this …


Слайд 15
And this …


Слайд 17
And that’s why Business doesn’t like it either …


Слайд 18

~80% of problems
caused by ~20% patterns
YES we know this

80% Dev Time

in Bug Fixing

$60B Defect Costs

BUT

Слайд 196 Situations on WHY this happened, HOW to avoid it


Слайд 21“Blindly” (Re)use Existing Components



Слайд 22
Requirement: We need a report


Слайд 23Using Hibernate results in 4k+ SQL Statements to display 3 items!
Hibernate

Executes 4k+ Statements

Individual Execution VERY FAST

But Total SUM takes 6s


Слайд 25Not every Architect makes good decisions


Слайд 26Symptoms
HTML takes between 60 and 120s to render
High GC Time
Assumptions
Bad GC

Tuning
Probably bad Database Performance as rendering was simple

Project: Online Room Reservation System


Слайд 27Developers built own monitoring
void roomreservationReport(int roomid)
{
long startTime = System.currentTimeMillis();
Object

data = loadDataForRoom(roomid);
long dataLoadTime = System.currentTimeMillis() - startTime;

generateReport(data, roomid);
}

Result:
Avg. Data Load Time: 45s!

DB Tool says:
Avg. SQL Query: <1ms!


Слайд 28#1: Loading too much data
24889! Calls to the Database API!
High CPU

and High Memory Usage to keep all data in Memory

Слайд 29#2: On individual connections
12444! individual connections
Classical N+1 Query Problem
Individual SQL really

<1ms

Слайд 30#3: Putting all data in temp Hashtable
Lots of time spent in

Hashtable.get

Called from their Entity Objects


Слайд 31Custom Measuring
Was impacted by Garbage Collection
Just measured overall time but not

# SQL Executions





Learn SQL and don’t use Hashtables as Workaround

Lesson Learned

void roomreservationReport(int roomid)
{
long startTime = System.currentTimeMillis();
Object data = loadDataForRoom(roomid);
long dataLoadTime = System.currentTimeMillis() - startTime;

generateReport(data, roomid);
}


Слайд 33Implementation Flaws


Слайд 34
Business Impact requires Action!


Слайд 35Solution: Cache to the RESCUE!!


Слайд 36Implementation and Rollout
Implemented InMemory Cache
Worked well in Load Testing


Слайд 37Result: Out of Memory Crashes!!

Still crashes
Problem fixed!
Fixed Version Deployed


Слайд 39Disconnected Teams


Слайд 40“Teamwork” between Dev and Ops
SEV1 Problem in Production
Need access to log

files

Where are they? Can’t get them

Need to increase log level

Can’t do! Can’t change config files in prod!


Слайд 41Solution: Implement a Custom “On Demand” Remote Logger


Слайд 42Implementation and Rollout
Implemented Custom Logger
Worked well in Load Testing


Слайд 43What happened?
~ 1Mio Lock Exceptions in 30 mins


Слайд 44Root Cause: A special WebSphere Setting!


Слайд 46“Deployment” Gone Bad!


Слайд 47Test Environment
Production Environment








8x slower
3x more SQL


Слайд 48Test Environment
Production Environment


Hibernate, Classloading, XML – The Key Hotspots
Hibernate, Classloading, XML

– The Key Hotspots

I/O for Web Requests doesn’t even show up!


That’s Normal: Having I/O for Web Request as main contributor


Слайд 49Top Contributor Class.getInterfaces
Called from Hibernates FieldInterceptionHelper
These calls all originate form thousands

of calls to find item by code

Слайд 50Top Methods related to XML Processing
Classloading is triggered through CustomMonnkey and

the Xalan Parser

Classloading is triggered through CustomMonkey and the Xalan Parser



Слайд 52#Push
without a Plan


Слайд 53
Mobile Landing Page of Super Bowl Ad
434 Resources in total on

that page:
230 JPEGs, 75 PNGs, 50 GIFs, …

Total size of ~ 20MB


Слайд 54Fifa.com during Worldcup
http://apmblog.compuware.com/2014/05/21/is-the-fifa-world-cup-website-ready-for-the-tournament/


Слайд 55Waiting for
Bug Reports


Слайд 56Look behind the scenes


Слайд 58Performance Clinic: Bring Your Own App
When: Thursday, December 18th
Lunch Session: NOON

– 3PM
After Work Session: 4PM – 7PM

Where: Dynatrace Office 404 Wyman Street, Waltham

Register: http://bit.ly/onlineperfclinic

Слайд 59Quick Demo


Слайд 60Get it here: http://bit.ly/dttrial
YouTube Tutorials: http://bit.ly/dttutorials
Live Q&A Sessions: http://bit.ly/onlineperfclinic
Contact me:

agrabner@dynatrace.com - @grabnerandi

Special Offer:
SaaS VIP Program: http://bit.ly/dtaasvip

30 Days Dynatrace Free Trial


Слайд 61Andreas Grabner
Dynatrace Developer Advocate
@grabnerandi
http://blog.dynatrace.com


Обратная связь

Если не удалось найти и скачать презентацию, Вы можете заказать его на нашем сайте. Мы постараемся найти нужный Вам материал и отправим по электронной почте. Не стесняйтесь обращаться к нам, если у вас возникли вопросы или пожелания:

Email: Нажмите что бы посмотреть 

Что такое ThePresentation.ru?

Это сайт презентаций, докладов, проектов, шаблонов в формате PowerPoint. Мы помогаем школьникам, студентам, учителям, преподавателям хранить и обмениваться учебными материалами с другими пользователями.


Для правообладателей

Яндекс.Метрика