appsphere 15 - php, node.js and python deep dive

44
PHP, Node.js and Python Deep Dive Omed Habib, Product Marketing

Upload: appdynamics

Post on 25-Jan-2017

770 views

Category:

Documents


8 download

TRANSCRIPT

Page 1: AppSphere 15 - PHP, Node.js and Python Deep Dive

PHP, Node.js and Python Deep Dive Omed Habib, Product Marketing

Page 2: AppSphere 15 - PHP, Node.js and Python Deep Dive

Agenda

2015 PHP Node.js

Copyright © 2015 AppDynamics. All rights reserved. 2

Python Developer Trends 4.2 Sneak Peak

Page 3: AppSphere 15 - PHP, Node.js and Python Deep Dive

2015 IN REVIEW

Page 4: AppSphere 15 - PHP, Node.js and Python Deep Dive

4.1 for PHP

Cross App Correlation Backend Naming Rules HTTP Data Collectors PHP 5.6 API Functions

Copyright © 2015 AppDynamics. All rights reserved. 4

Page 5: AppSphere 15 - PHP, Node.js and Python Deep Dive

4.1 for Node.js

Error Detection Using HTTP Return Codes Node.js Backends Discovery & Grouping Rules Object Instance Tracking Node.js 0.12 API Functions

Copyright © 2015 AppDynamics. All rights reserved. 5

Page 6: AppSphere 15 - PHP, Node.js and Python Deep Dive

4.1 for Python

Distributed Transaction Correlation Cross-App Correlation Custom Match/Exclude Rules Linux & Mac OOTB WSGI Framework Support API Functions

Copyright © 2015 AppDynamics. All rights reserved. 6

Page 7: AppSphere 15 - PHP, Node.js and Python Deep Dive

PHP DEEP DIVE

Page 8: AppSphere 15 - PHP, Node.js and Python Deep Dive

Challenge

Multiple PHP “applications” on a single server

Copyright © 2015 AppDynamics. All rights reserved. 8

Page 9: AppSphere 15 - PHP, Node.js and Python Deep Dive

api.acme.com login.acme.com admin.acme.com www.acme.com

Copyright © 2015 AppDynamics. All rights reserved. 9

Page 10: AppSphere 15 - PHP, Node.js and Python Deep Dive

Before

n applications on the same server =

1 application in AppDynamics Copyright © 2015 AppDynamics. All rights reserved. 10

Page 11: AppSphere 15 - PHP, Node.js and Python Deep Dive

Today

n applications on the same server =

n applications in AppDynamics Copyright © 2015 AppDynamics. All rights reserved. 11

Page 12: AppSphere 15 - PHP, Node.js and Python Deep Dive

Copyright © 2015 AppDynamics. All rights reserved. 12

Page 13: AppSphere 15 - PHP, Node.js and Python Deep Dive

Before

appdynamics_agent.ini

Copyright © 2015 AppDynamics. All rights reserved. 13

Page 14: AppSphere 15 - PHP, Node.js and Python Deep Dive

Today

appdynamics_agent.ini

httpd.conf

.htaccess

Copyright © 2015 AppDynamics. All rights reserved. 14

Page 15: AppSphere 15 - PHP, Node.js and Python Deep Dive

More Flexibility with (same) Configs

agent.controller.hostName agent.controller.port agent.applicationName agent.tierName agent.nodeName agent.accountName agent.accountAccessKey

Copyright © 2015 AppDynamics. All rights reserved. 15

Page 16: AppSphere 15 - PHP, Node.js and Python Deep Dive

Two Separate Apps, Same Server

<VirtualHost *:80> DocumentRoot "/Library/WebServer/Documents" ServerName localhost ErrorLog "/private/var/log/apache2/error_log" CustomLog "/private/var/log/apache2/access_log" common php_value agent.applicationName FrontEnd php_value agent.tierName FrontTier php_value agent.nodeName front-node1 </VirtualHost>

Copyright © 2015 AppDynamics. All rights reserved. 16

<VirtualHost *:80> DocumentRoot "/var/www" ServerName test.local <Directory "/var/www"> Options FollowSymLinks Multiviews AllowOverride Options Require all granted </Directory> ErrorLog "/private/var/log/apache2/error_log" CustomLog "/private/var/log/apache2/access_log" common php_value agent.applicationName API php_value agent.tierName APItier php_value agent.nodeName api-node1 </VirtualHost>

Page 17: AppSphere 15 - PHP, Node.js and Python Deep Dive

Copyright © 2015 AppDynamics. All rights reserved. 17

Page 18: AppSphere 15 - PHP, Node.js and Python Deep Dive

Copyright © 2015 AppDynamics. All rights reserved. 18

Page 19: AppSphere 15 - PHP, Node.js and Python Deep Dive

Copyright © 2015 AppDynamics. All rights reserved. 19

Page 20: AppSphere 15 - PHP, Node.js and Python Deep Dive

Multi-Node Support for PHP

Page 21: AppSphere 15 - PHP, Node.js and Python Deep Dive

Few points to consider…

•  Available for beta after AppSphere •  4.2 Controller is recommended •  All apps will share same proxy on server •  Licenses will stay same (per node) until adjusted •  Currently in beta, hoping to GA in 4.2 •  Proxy functionality will be replaced with LibAgent in 2016

Copyright © 2015 AppDynamics. All rights reserved. 21

Page 22: AppSphere 15 - PHP, Node.js and Python Deep Dive

NODE.JS DEEP DIVE

Page 23: AppSphere 15 - PHP, Node.js and Python Deep Dive

Challenge

Heavy Memory Consumption by the Node.js Application

Copyright © 2015 AppDynamics. All rights reserved. 23

Page 24: AppSphere 15 - PHP, Node.js and Python Deep Dive

Memory Leak Diagnostics

Page 25: AppSphere 15 - PHP, Node.js and Python Deep Dive

V8 Manages Memory

Pro

•  You don’t have to worry about it.

•  You don’t have to write code to manage it.

Con

•  You don’t have control over it.

•  You have to find a way to find your memory leak.

Copyright © 2015 AppDynamics. All rights reserved. 25

Page 26: AppSphere 15 - PHP, Node.js and Python Deep Dive

Copyright © 2015 AppDynamics. All rights reserved. 26

Page 27: AppSphere 15 - PHP, Node.js and Python Deep Dive

Copyright © 2015 AppDynamics. All rights reserved. 27

Page 28: AppSphere 15 - PHP, Node.js and Python Deep Dive

Copyright © 2015 AppDynamics. All rights reserved. 28

Page 29: AppSphere 15 - PHP, Node.js and Python Deep Dive

“I can actually say we've had no outages in production on a Node.js cluster, since we've been porting over, and I can credit a large part of that due to the monitoring of AppDynamics.” Stace Baal, Director of Engineering @ eHarmony

Copyright © 2015 AppDynamics. All rights reserved. 29

Page 30: AppSphere 15 - PHP, Node.js and Python Deep Dive

PYTHON DEEP DIVE

Page 31: AppSphere 15 - PHP, Node.js and Python Deep Dive

Challenge

A Python Application Executing Jobs in an Infinite While Loop

Copyright © 2015 AppDynamics. All rights reserved. 31

Page 32: AppSphere 15 - PHP, Node.js and Python Deep Dive

The Loop

setup() while (true):

do_work() teardown()

Copyright © 2015 AppDynamics. All rights reserved. 32

Page 33: AppSphere 15 - PHP, Node.js and Python Deep Dive

Python Agent API Functions

Copyright © 2015 AppDynamics. All rights reserved. 33

Functions made available to the application code to

further tailor your APM solution.

Page 34: AppSphere 15 - PHP, Node.js and Python Deep Dive

Copyright © 2015 AppDynamics. All rights reserved. 34

from  appdynamics.agent  import  api  as  appd                  setup()        while  (true):  

bt_handle  =  appd.start_bt('do  work’)  try:          do_work()  except  Exception  as  exc:          raise  finally:          appd.end_bt(bt_handle,  exc)  

   teardown()  

Page 35: AppSphere 15 - PHP, Node.js and Python Deep Dive

Custom Exit Calls

Copyright © 2015 AppDynamics. All rights reserved. 35

start_exit_call() …

end_exit_call()

Page 36: AppSphere 15 - PHP, Node.js and Python Deep Dive

API Functions

Copyright © 2015 AppDynamics. All rights reserved. 36

•  init(environ=None, timeout_ms=NO_TIMEOUT) •  shutdown(timeout_ms=None) •  start_bt(name, correlation_header=None) •  end_bt(bt_handle, exc=None) •  add_snapshot_data(bt_handle, key, value) •  get_active_bt_handle(request) •  start_exit_call(bt_handle, exit_type, display_name,

identifying_properties, optional_properties=None) •  end_exit_call(exit_call_handle, exc=None) •  make_correlation_header(bt_handle, exit_call_handle) •  bt(name, correlation_header=None) •  exit_call(bt_handle, exit_type, display_name, identifying_properties,

optional_properties=None)

Page 37: AppSphere 15 - PHP, Node.js and Python Deep Dive

Copyright © 2015 AppDynamics. All rights reserved. 37

By The Way...

API Functions Are Available Today For

Page 38: AppSphere 15 - PHP, Node.js and Python Deep Dive

“The new Python agent by AppDynamics brought the visibility that we’ve come to expect from the AppDynamics Platform. It didn't take long for us to qualify that this was the solution for our deployments of over 3,000 Python instances” Albert Kemner, Principal Engineer @ Gannett

Copyright © 2015 AppDynamics. All rights reserved. 38

Page 39: AppSphere 15 - PHP, Node.js and Python Deep Dive

Copyright © 2015 AppDynamics. All rights reserved. 39

Page 40: AppSphere 15 - PHP, Node.js and Python Deep Dive

DEVELOPER TRENDS

Page 41: AppSphere 15 - PHP, Node.js and Python Deep Dive

Decoupling Architecture +

Mindset =

Merging Teams Copyright © 2015 AppDynamics. All rights reserved. 41

Page 42: AppSphere 15 - PHP, Node.js and Python Deep Dive

WHAT’S COMING IN 4.2?

Page 43: AppSphere 15 - PHP, Node.js and Python Deep Dive

4.2 Roadmap Goal

•  Multi-Node Support •  SELinux •  NuSOAP Exit Calls •  PostgreSQL

Copyright © 2015 AppDynamics. All rights reserved. 43

•  Node.js 4.0 & 5.0 •  Allocation Snapshots •  Transaction Analytics •  Heroku Support •  Windows Support

•  EUM Correlation •  API Functions •  Data Collectors •  MongoDB

Page 44: AppSphere 15 - PHP, Node.js and Python Deep Dive

Thank You