下吧开发总结

5,509 views

Published on

chinavisual privately project summary.

Published in: Technology, Education
0 Comments
7 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
5,509
On SlideShare
0
From Embeds
0
Number of Embeds
3,043
Actions
Shares
0
Downloads
80
Comments
0
Likes
7
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • 下吧开发总结

    1. 1. @nightsailer
    2. 2. • • •• •
    3. 3. • • • • •
    4. 4. • • • • • 99%
    5. 5. • • • • •
    6. 6. • • HTML/CSS) • Pagespeed • image •
    7. 7. • • • •
    8. 8. • • • •
    9. 9. • • • •
    10. 10. • • PBP • Perl Best Practices • UTF-8 • css, @charset
    11. 11. • Git • • branch/rebase/stash • GUI • gix/git-tower for mac •
    12. 12. • • PHP-fpm • PECL • Nginx •
    13. 13. • MongoDB/Installation • • 32bit OS 2G 64bit •
    14. 14. • MongoDB/Model • DoggyX_Model_Mongo_Base • CRUD method • proxy method • proxy_method like: add_user($name,
    15. 15. • DoggyX_Model_Mongo_Base • _id 3 • MONGO_ID_NATIVE • MONGO_ID_SEQ • MONGO_ID_CUSTOM
    16. 16. • MONGO_ID_NATIVE • new MongoID• MONGO_ID_SEQ • auto-increment• MONGO_ID_CUSTOM • _id
    17. 17. • Don’t use MongoDateTime, it’s suck!• Timestamp • protected $created_timestamp_fields = array(created_on,updated_on); • $updated_timestamp_fields = array(updated_on); • auto_update_timestamp
    18. 18. • Create/Insert created_timestamp_fields• model save/update* updated_timestamp_fields•
    19. 19. • Event/Hook model • before_save(&$data) • before_update(&$data) • after_save • validate • • return false
    20. 20. • Session • DoggyX_Session_Service( ) • on_service_init • on_service_stop • load_visitor • bind_session_to_action($action) • , Interceptor
    21. 21. • Session • DoggyX_Interceptor_XSession • check_session_auth($service, $invocation) • session
    22. 22. • Session • Session_Servie session, session cookie • , session is_login=true, visitor->id id • visitor • destroy session
    23. 23. • Session • Session state, • Session # Cache! • Session Clean Perl service
    24. 24. •• Redmine • /Milestone • • Issues Track
    25. 25. • Issue Track / Roadmap • • • • •
    26. 26. ••
    27. 27. • • • debug••
    28. 28. • • cookie • css/javascript/images • Javascript • Css • Image , css spirit
    29. 29. • /Exipres • Cache • query Cache • Url-rewrite • /css/v0.0.9-b200910/base.css • => /css/base.css • css/
    30. 30. • • • • Gearman • Perl PHP Worker • PHP is suck!
    31. 31. • PHP • • • IO • IO• Gearman Job
    32. 32. • MongoDB • Query • Type cast: (int) $user_id • Query sort • •• vmstat
    33. 33. • copy&paste• Bench••
    34. 34. • • •• •
    35. 35. •• Scale-out• • GUI •
    36. 36. • • • MongoDB RS• • • Gearman+VPN
    37. 37. • C10K • C10K 3 • Nginx• How? • Starman is good, but • Prefork C10K
    38. 38. • Quick work around: • Evented IO, Twiggy! • AnyEvent based • Archive PSGI AE • Must keep non-blocking IO • Nginx upstream balance!
    39. 39. • Works fine, Nginx upstream balance! upsteam xiaba { server 127.0.0.1:9001; server 127.0.0.1:9002; .... }• TODO • Nginx-Lua/Nginx-Misc/Echo • Low latency!

    ×