当前位置: 首页 > news >正文

长春电商网站建设公司电话大学生网站规划建设

长春电商网站建设公司电话,大学生网站规划建设,厦门模板建站系统,wordpress无法安装插件一#xff1a;背景 1. 讲故事前段时间有位朋友说他的程序 CPU 出现了暴涨现象#xff0c;由于程序是买来的#xff0c;所以问题就比较棘手了#xff0c;那既然找到我#xff0c;就想办法帮朋友找出来吧#xff0c;分析下来#xff0c;问题比较经典#xff0c;有必要和大… 一背景 1. 讲故事前段时间有位朋友说他的程序 CPU 出现了暴涨现象由于程序是买来的所以问题就比较棘手了那既然找到我就想办法帮朋友找出来吧分析下来问题比较经典有必要和大家做一下分享。二WinDbg 分析 1. CPU 真的爆高吗一直关注这个系列的朋友应该知道用 !tp 验证即可。0:161 !tp CPU utilization: 81% Worker Thread: Total: 486 Running: 486 Idle: 0 MaxLimit: 8191 MinLimit: 24 Work Request in Queue: 0 -------------------------------------- Number of Timers: 1 -------------------------------------- Completion Port Thread:Total: 6 Free: 1 MaxFree: 48 CurrentLimit: 6 MaxLimit: 1000 MinLimit: 24果然 CPU 81% 并且当前的 481 个工作线程全部打满以经验看可能是遇到锁什么的不过还是先从是否触发 GC 看起。2. 是触发 GC 了吗要查看是否触发 GC可以用 !t -special 看看是否有 SuspendEE 字样。0:161 !t -special ThreadCount:      604 UnstartedThread:  0 BackgroundThread: 587 PendingThread:    0 DeadThread:       11 Hosted Runtime:   noOSID Special thread type29 2e74 DbgHelper 30 1014 GC SuspendEE 31 4a84 GC 32 4a48 GC ...52 37c0 GC 53 47a0 GC 54 4620 Finalizer 55 1aa4 ProfilingAPIAttach...从卦中看30号线程果然挂了 SuspendEE并且还是一个 GC 线程接下来切过去看看此时 GC 正在做什么0:161 ~~[1014]s eax00000000 ebx0724fc10 ecx00000000 edx00000000 esi00000000 edi0724fc10 eip77ddf02c esp0724fbd0 ebp0724fc34 iopl0         nv up ei pl nz ac po nc cs0023  ss002b  ds002b  es002b  fs0053  gs002b             efl00000212 ntdll!NtDelayExecution0xc: 77ddf02c c20800          ret     8 0:030 k# ChildEBP RetAddr       00 0724fc34 758345da     ntdll!NtDelayExecution0xc 01 0724fc34 738a74eb     KERNELBASE!SleepEx0x8a 02 0724fc78 73a0f710     clr!EESleepEx0x59 03 0724fc78 73a0f809     clr!SVR::gc_heap::mark_steal0x27c 04 0724fcd0 73a17930     clr!SVR::gc_heap::mark_phase0x3d0 05 0724fd0c 73a17dc9     clr!SVR::gc_heap::gc10xf2 06 0724fd5c 73a174a1     clr!SVR::gc_heap::garbage_collect0x746 07 0724fd78 73a10d7e     clr!SVR::gc_heap::gc_thread_function0x14a 08 0724fd98 73a10d0f     clr!SVR::gc_heap::gc_thread_stub0x72 09 0724fdac 750e62c4     clr!GCThreadStub0x1f 0a 0724fdc0 77dd1f69     kernel32!BaseThreadInitThunk0x24 0b 0724fe08 77dd1f34     ntdll!__RtlUserThreadStart0x2f 0c 0724fe18 00000000     ntdll!_RtlUserThreadStart0x1b从卦中的 gc_thread_function 函数看这是一个阻塞版的 GC 线程当前正处于 mark_phase 标记阶段并且还在抢其他 GC 线程的活有点意思。。。既然是触发了 GC 那就看下触发了哪一代以及什么原因触发的。0:030 x clr!*gc_heap::settings* 73f15da8          clr!WKS::gc_heap::settings  no type information 73f13520          clr!SVR::gc_heap::settings  no type information 0:030 dp 73f13520  73f13520  00002df0 00000002 00000001 00000001 73f13530  00000000 00000000 00000000 00000000 73f13540  00000000 00000000 00000000 00000000 73f13550  00000000 00000000 00000005 00000001 73f13560  00000000 00000000 00000000 00000001 73f13570  00000000 0000005a 00000000 00000001 73f13580  05f71b40 86b2ee2e 00040000 00000001 73f13590  00000002 00002000 00000002 00000000从卦中的 00000002 和 00000005 可知当前触发的是 2代 GC原因是 5那 5 是什么意思可以看下 clr 中的 gc_reason 即可。enum gc_reason {reason_alloc_soh  0,reason_induced  1,reason_lowmemory  2,reason_empty  3,reason_alloc_loh  4,reason_oos_soh  5,reason_oos_loh  6,reason_induced_noforce  7, // its an induced GC and doesnt have to be blocking.reason_gcstress  8,        // this turns into reason_induced  gc_mechanisms.stress_induced  truereason_lowmemory_blocking  9,reason_induced_compacting  10,reason_lowmemory_host  11,reason_pm_full_gc  12, // provisional mode requested to trigger full GCreason_lowmemory_host_blocking  13,reason_bgc_tuning_soh  14,reason_bgc_tuning_loh  15,reason_bgc_stepping  16,reason_max };也就是上面的 reason_oos_soh表示当前的小对象堆中的段空间满了那是不是呢可以用 !eeheap -gc 看下托管堆。0:030 !eeheap -gc Number of GC Heaps: 24 ------------------------------ Heap 0 (06d00138) generation 0 starts at 0xe8a380ec generation 1 starts at 0xe8a380e0 generation 2 starts at 0x07311000 ephemeral segment allocation context: (0xe8a380f8, 0xe8a38104)segment     begin  allocated      size 07310000  07311000  0830fd5c  0xffed5c(16772444) a86a0000  a86a1000  a969fd10  0xffed10(16772368) e8a10000  e8a11000  e8a380f8  0x270f8(159992) Large object heap starts at 0x1f311000segment     begin  allocated      size 1f310000  1f311000  1f4cafb0  0x1b9fb0(1810352) Heap Size:       Size: 0x21deb14 (35515156) bytes. ------------------------------ ... Heap 22 (06d76910) generation 0 starts at 0xbfd5d228 generation 1 starts at 0xbfd5ce20 generation 2 starts at 0x1d311000 ephemeral segment allocation context: (0xbfd5d234, 0xbfd5d240)segment     begin  allocated      size 1d310000  1d311000  1e30fe64  0xffee64(16772708) bed60000  bed61000  bfd5d234  0xffc234(16761396) Large object heap starts at 0x2a311000segment     begin  allocated      size 2a310000  2a311000  2a311010  0x10(16) Heap Size:       Size: 0x1ffb0a8 (33534120) bytes. ... ------------------------------ GC Heap Size:    Size: 0x2f6f6d18 (795831576) bytes.可以看到heap 上很多都是 segment16M  打满状态停。。。为什么 segment 只有 16M 出现了一个重大线索。3. 重大线索解读一个 Server 版的 GC拥有高达 24 个逻辑核居然只有 16M 的 segment这么小的 segment很容易被一些快进快出的大内存操作给打满也就更容易造成 GC 触发而且还是 Full GC版本信息如下0:030 !eeversion 4.7.3416.0 retail Server mode with 24 gc heaps SOS Version: 4.7.3416.0 retail build接下来到线程栈上找找有没有快进快出的大内存操作。4. 寻找大内存操作既然有快进快出的操作在 GC 触发时肯定还会躺在 托管堆 上我们就从这里入手。0:030 !dumpheap -stat Statistics:MT    Count    TotalSize Class Name ... 06cd1750   638727     15899642      Free 30361270   171401     19196912 xxxx.Entities.ProductInventoryLog 30360f90   537090     32225400 xxxx.Entities.ProductInventoryEpcDetail 30f9a148   171404     67875600 System.Data.Entity.Core.Objects.StateManagerValue[] 3036074c   694875     97282500 xxxx.Entities.ProductBorrow 727efd60  8419815    394836372 System.String Total 14577631 objects Fragmented blocks larger than 0.5 MB:Addr     Size      Followed by 9b0bf500    0.5MB         9b141878 System.Byte[]从托管堆看有不少的类对象接下来抽一个 xxxx.Entities.ProductInventoryEpcDetail 看下引用然后查根对象的 size。0:161 !gcroot a8780ecc Thread 40b8:df90d330 715d143a System.Linq.EnumerableJoinIteratord__384[[System.__Canon, mscorlib],[System.__Canon, mscorlib],[System.__Canon, mscorlib],[System.__Canon, mscorlib]].MoveNext()esi: -  090eeba4 System.Linq.EnumerableJoinIteratord__384[]...-  a8780e80 xxxx.Entities.ProductInventoryEpcDetail[]-  a8780ecc xxxx.Entities.ProductInventoryEpcDetailFound 1 unique roots (run !GCRoot -all to see all roots).其实这个引用链特别长用 !objsize 090eeba4 显示对象大小一直都是卡住中size 肯定不小 接下来我们切入到 40b8 看下这个方法可以发现一个非常复杂的 EF 写法又是 outer又是 inner又要再关联截图如下到这里大对象操作终于找到了我发现还有其他方法也有一些 EF 复杂操作就不一一列举了。三总结 这个 dump 给我们两个教训当 sql 很复杂时千万不要用 EF 去写这中间会产生多少个临时对象你真的搞不清楚你也hold不住建议直接改成 sql简单粗暴。程序尽量用 64bit 部署否则你的 segment 会太小太容易让 GC 上头了。
http://www.yutouwan.com/news/157193/

相关文章:

  • 互联业务登录页 网站网站主页 优帮云
  • 深圳最好的营销网站建设公司美容店网站建设
  • 移动端网站开发语言企业网站整合
  • 会计上大额网站费如何做分录短视频制作软件app
  • 合肥网站建设兼职wordpress 菜单显示
  • 电商网站入口门户网站建设公司哪家好
  • 榆林网络公司建设网站自助建站在线快速建站
  • 海创网站建设wordpress外观
  • 园林绿化网站建设dz网站模板 首页显示内容
  • 哈尔滨市呼兰区住房城乡建设局网站门户网站建设及运营
  • 网站建设的具体步骤网站制作 南通
  • 网站开发浏览器的使用网站建设的主要流程
  • 技术支持 祥云平台 英文网站截屏的图片wordpress不能显示
  • 公司网站 seoWordPress搜索引擎链接提交
  • 做网站低价郑州网站推广
  • 杭州网站建设公司有哪些wordpress证书关闭
  • 移动建站优化网站做相册
  • 有什么网站可以做电台wordpress 怎么安装ssl
  • 哪家网站开发培训好wordpress 主题更改前台字体
  • 泰安做网站哪家好天津市建设安全协会网站
  • 网站开发最重要的技巧seo经理
  • 百度网站权重查询最近国际新闻热点
  • 广州网站优化排名哪家好网销怎么销售的
  • vs做网站怎么上如何申请一个网站 新网
  • 如何做下载网站如何在百度上做产品推广
  • 建设企业网站的时间本地架设wordpress
  • php网站有点设计师网页导航官网
  • 淘宝网站开发源码个性化网站有哪些
  • 成都建站贵州软件开发 网站开发
  • 任务网站建设平度网站建设